Class: Sequel::Model::Associations::OneToManyAssociationReflection

Class | Sequel::Model::Associations::OneToManyAssociationReflection
In: | lib/sequel_model/association_reflection.rb
Parent: | AssociationReflection

### Methods

default_key eager_loader_key primary_key reciprocal_array? set_reciprocal_to_self?

### Public Instance methods

default_key()

Default foreign key name symbol for key in associated table that points to current table‘s primary key.

[Source]

         # 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

eager_loader_key()

The key to use for the key hash when eager loading

[Source]

         # File lib/sequel_model/association_reflection.rb, line 181
    181:     def eager_loader_key
    182:       primary_key
    183:     end

primary_key()

The column in the current table that the key in the associated table references.

[Source]

         # File lib/sequel_model/association_reflection.rb, line 186
    186:     def primary_key
    187:      self[:primary_key] ||= self[:model].primary_key
    188:     end

reciprocal_array?()

Whether the reciprocal of this association returns an array of objects instead of a single object, false for a one_to_many association.

[Source]

         # File lib/sequel_model/association_reflection.rb, line 197
    197:     def reciprocal_array?
    198:       false
    199:     end

set_reciprocal_to_self?()

One to many associations set the reciprocal to self.

[Source]

         # File lib/sequel_model/association_reflection.rb, line 191
    191:     def set_reciprocal_to_self?
    192:       true
    193:     end

[Validate]