Module: UuidAssociations::ActiveRecord::AssociationMethodDefinitions
- Defined in:
- lib/uuid_associations/active_record/association_method_definitions.rb
Instance Method Summary collapse
- #belongs_to(name, scope = nil, **options) ⇒ Object
- #has_many(name, scope = nil, **options, &extension) ⇒ Object
Instance Method Details
#belongs_to(name, scope = nil, **options) ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'lib/uuid_associations/active_record/association_method_definitions.rb', line 16 def belongs_to(name, scope = nil, **) original_payload = super(name, scope, **) return original_payload if original_payload.key?('left_side') RelationshipDefinitions::BelongsTo.define_accesors_for(self, original_payload, name) original_payload end |
#has_many(name, scope = nil, **options, &extension) ⇒ Object
9 10 11 12 13 14 |
# File 'lib/uuid_associations/active_record/association_method_definitions.rb', line 9 def has_many(name, scope = nil, **, &extension) original_payload = super(name, scope, **, &extension) RelationshipDefinitions::HasMany.define_accesors_for(self, original_payload, name) original_payload end |