Module: MR::FakeRecord::Attributes::ClassMethods

Defined in:
lib/mr/fake_record/attributes.rb

Instance Method Summary collapse

Instance Method Details

#attribute(name, type, options = nil) ⇒ Object



20
21
22
# File 'lib/mr/fake_record/attributes.rb', line 20

def attribute(name, type, options = nil)
  self.attributes.add(self, name, type, options)
end

#attributesObject



16
17
18
# File 'lib/mr/fake_record/attributes.rb', line 16

def attributes
  @attributes ||= MR::FakeRecord::AttributeSet.new
end

#columnsObject

ActiveRecord methods



26
27
28
# File 'lib/mr/fake_record/attributes.rb', line 26

def columns
  self.attributes.to_a
end