Class: BlocRecord::Base
- Inherits:
-
Object
- Object
- BlocRecord::Base
- Extended by:
- Associations, Connection, Schema, Selection
- Includes:
- Persistence
- Defined in:
- lib/bloc_record/base.rb
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Base
constructor
A new instance of Base.
Methods included from Selection
all, find, find_by, find_one, first, group, group_by_ids, join, last, limit, order, select, take, take_one, where
Methods included from Schema
attributes, columns, count, schema, table
Methods included from Connection
Methods included from Associations
Methods included from Persistence
#destroy, included, #save, #save!, #update_attribute, #update_attributes
Constructor Details
#initialize(options = {}) ⇒ Base
Returns a new instance of Base.
17 18 19 20 21 22 23 24 |
# File 'lib/bloc_record/base.rb', line 17 def initialize(={}) = BlocRecord::Utility.convert_keys() self.class.columns.each do |col| self.class.send(:attr_accessor, col) self.instance_variable_set("@#{col}", [col]) end end |