| Class | Sequel::Model::Associations::OneToManyAssociationReflection |
| In: |
lib/sequel_model/association_reflection.rb
|
| Parent: | AssociationReflection |
Default foreign key name symbol for key in associated table that points to current table‘s primary key.
# File lib/sequel_model/association_reflection.rb, line 176
176: def default_key
177:
178: "#{self[:model].name.to_s.demodulize.underscore}_id"
179: end
The key to use for the key hash when eager loading
# File lib/sequel_model/association_reflection.rb, line 181
181: def eager_loader_key
182: primary_key
183: end
The column in the current table that the key in the associated table references.
# File lib/sequel_model/association_reflection.rb, line 186
186: def primary_key
187: self[:primary_key] ||= self[:model].primary_key
188: end
Whether the reciprocal of this association returns an array of objects instead of a single object, false for a one_to_many association.
# File lib/sequel_model/association_reflection.rb, line 197
197: def reciprocal_array?
198: false
199: end