Class: HasManyOptions
- Inherits:
-
AssocOptions
- Object
- AssocOptions
- HasManyOptions
- Defined in:
- lib/reloj/orm/associatable.rb
Instance Attribute Summary
Attributes inherited from AssocOptions
#class_name, #foreign_key, #primary_key
Instance Method Summary collapse
-
#initialize(name, self_class_name, options = {}) ⇒ HasManyOptions
constructor
A new instance of HasManyOptions.
Methods inherited from AssocOptions
Constructor Details
#initialize(name, self_class_name, options = {}) ⇒ HasManyOptions
Returns a new instance of HasManyOptions.
34 35 36 37 38 39 40 41 42 43 |
# File 'lib/reloj/orm/associatable.rb', line 34 def initialize(name, self_class_name, = {}) defaults = { foreign_key: "#{self_class_name.to_s.underscore}_id".to_sym, primary_key: :id, class_name: name.to_s.singularize.camelcase }.merge() defaults.each do |attribute, value| self.send("#{attribute}=", value) end end |