Module: Armada::AttributeMethods::ClassMethods
- Defined in:
- lib/armada/attribute_methods.rb
Instance Method Summary collapse
- #add_columns(*cols) ⇒ Object (also: #add_column)
- #define_attribute_methods ⇒ Object
- #remove_columns(*cols) ⇒ Object (also: #remove_column)
Instance Method Details
#add_columns(*cols) ⇒ Object Also known as: add_column
16 17 18 |
# File 'lib/armada/attribute_methods.rb', line 16 def add_columns(*cols) self.columns = (self.columns + cols.map(&:to_sym)).uniq end |
#define_attribute_methods ⇒ Object
26 27 28 |
# File 'lib/armada/attribute_methods.rb', line 26 def define_attribute_methods super(self.columns) end |
#remove_columns(*cols) ⇒ Object Also known as: remove_column
21 22 23 |
# File 'lib/armada/attribute_methods.rb', line 21 def remove_columns(*cols) self.columns = (self.columns - cols.map(&:to_sym).delete_if { |x| x == :id }) end |