Class | Sequel::Model::Associations::OneToManyAssociationReflection
In: | lib/sequel/model/associations.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/associations.rb, line 194
    194:         def default_key
    195:
    196:           "#{underscore(demodulize(self[:model].name))}_id"
    197:         end

eager_loader_key()

Alias for primary_key

primary_key()

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

[Source]

         # File lib/sequel/model/associations.rb, line 199
    199:         def primary_key
    200:          self[:primary_key] ||= self[:model].primary_key
    201:         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/associations.rb, line 211
    211:         def reciprocal_array?
    212:           false
    213:         end

set_reciprocal_to_self?()

One to many associations set the reciprocal to self when loading associated records.

[Source]

         # File lib/sequel/model/associations.rb, line 205
    205:         def set_reciprocal_to_self?
    206:           true
    207:         end

[Validate]