Class: Clowne::Adapters::ActiveRecord::Associations::BelongsTo
- Inherits:
-
Base
- Object
- Base::Association
- Base
- Clowne::Adapters::ActiveRecord::Associations::BelongsTo
- Defined in:
- lib/clowne/adapters/active_record/associations/belongs_to.rb
Instance Method Summary collapse
Instance Method Details
#call(record) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/clowne/adapters/active_record/associations/belongs_to.rb', line 8 def call(record) child = association return record unless child unless declaration.scope.nil? warn( "[Clowne] Belongs to association does not support scopes " \ "(#{@association_name} for #{@source.class})" ) end child_clone = clone_one(child) record.__send__(:"#{association_name}=", child_clone) record end |