module MR::FakeRecord::Attributes::InstanceMethods

Attributes

saved_attributes[W]

Public Instance Methods

attributes() click to toggle source

ActiveRecord methods

# File lib/mr/fake_record/attributes.rb, line 42
def attributes
  self.class.attributes.read_all(self)
end
attributes=(new_attributes) click to toggle source
# File lib/mr/fake_record/attributes.rb, line 46
def attributes=(new_attributes)
  return unless new_attributes.is_a?(Hash)
  self.class.attributes.batch_write(new_attributes, self)
end
column_for_attribute(name) click to toggle source
# File lib/mr/fake_record/attributes.rb, line 51
def column_for_attribute(name)
  self.class.attributes.find(name)
rescue NoAttributeError
  return nil
end
saved_attributes() click to toggle source
# File lib/mr/fake_record/attributes.rb, line 36
def saved_attributes
  @saved_attributes ||= {}
end