Module: Armada::AttributeMethods::ClassMethods

Defined in:
lib/armada/attribute_methods.rb

Instance Method Summary collapse

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_methodsObject



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