Class: HasManyOptions
- Inherits:
-
AssocOptions
- Object
- AssocOptions
- HasManyOptions
- Defined in:
- lib/bezelrecord_base/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.
29 30 31 32 33 34 |
# File 'lib/bezelrecord_base/associatable.rb', line 29 def initialize(name, self_class_name, = {}) @foreign_key = [:foreign_key] || (self_class_name.to_s + "Id").underscore.to_sym @primary_key = [:primary_key] || :id @class_name = [:class_name] || name.to_s.singularize.camelcase end |