Module: ActiverecordUtilities::ClassMethods

Defined in:
lib/activerecord_utilities.rb

Instance Method Summary (collapse)

Instance Method Details

- (Symbol) nil_trim_attributes(*attributes)

any def inside here is a class method

Parameters:

  • attributes (Symbol, Array)

Returns:

  • (Symbol)


19
20
21
22
# File 'lib/activerecord_utilities.rb', line 19

def nil_trim_attributes(*attributes) # this assigns the attributes to be trimmed
  raise('no attributes to trim') if (attributes.map(&:to_s) - self.column_names) != []
  self.attributes_to_trim = attributes
end