Method: Fera::Base#load

Defined in:
lib/fera/models/base.rb

#load(attributes, *args) ⇒ Object



118
119
120
121
122
123
124
125
126
127
128
129
130
# File 'lib/fera/models/base.rb', line 118

def load(attributes, *args)
  load_result = super(attributes, *args)

  attributes.each do |attr, val|
    if respond_to?("#{ attr }=".to_sym)
      self.send("#{ attr }=".to_sym, val)
    end
  end

  @clean_copy = clone_with_nil if persisted? && !options[:cloned]

  load_result
end