Module | ColumnsExtension::ClassMethods
In: | lib/columns_extension.rb

### Methods

editable_columns readable_columns required required_columns validates_presence_of

### Public Instance methods

editable_columns()

[Source]

        # File lib/columns_extension.rb, line 34
    34:     def editable_columns
    35:       return readable_columns.reject do |column|
    36:         /\A(?:id|(?:cre|upd)ated_(?:at|by|in|on)|parent_id|lft|rgt|position|lock_version)\z/ =~ column.name
    37:       end
    38:     end

readable_columns()

[Source]

        # File lib/columns_extension.rb, line 10
    10:     def readable_columns
    11:       c = List.find_by_model_name(self.name)
    12:       if c
    13:         return self.columns_hash.values_at(*c.public_items)
    14:       else
    15:         return content_columns
    16:       end
    17:     end

required(*columns)

[Source]

        # File lib/columns_extension.rb, line 24
    24:     def required(*columns)
    25:       write_inheritable_array(:required_columns, columns.map(&:to_s))
    26:     end

required_columns()

[Source]

        # File lib/columns_extension.rb, line 19
    19:     def required_columns
    20:       column_names = read_inheritable_attribute(:required_columns) || []
    21:       return columns_hash.values_at(*column_names)
    22:     end

validates_presence_of(*attr_names)

[Source]

        # File lib/columns_extension.rb, line 28
    28:     def validates_presence_of(*attr_names)
    29:       super
    30:       attr_names.pop if attr_names.last.is_a?(Hash)
    31:       required(*attr_names)
    32:     end

[Validate]