Class: ActiveRecord::Associations::Builder::BelongsTo
- Inherits:
-
SingularAssociation
- Object
- Association
- SingularAssociation
- ActiveRecord::Associations::Builder::BelongsTo
- Defined in:
- lib/active_record/associations/builder/belongs_to.rb
Overview
:nodoc:
Instance Attribute Summary
Attributes inherited from Association
#model, #name, #options, #reflection
Instance Method Summary collapse
Methods inherited from SingularAssociation
Methods inherited from Association
Constructor Details
This class inherits a constructor from ActiveRecord::Associations::Builder::Association
Instance Method Details
#build ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/active_record/associations/builder/belongs_to.rb', line 13 def build reflection = super add_counter_cache_callbacks(reflection) if [:counter_cache] add_touch_callbacks(reflection) if [:touch] configure_dependency reflection end |
#constructable? ⇒ Boolean
9 10 11 |
# File 'lib/active_record/associations/builder/belongs_to.rb', line 9 def constructable? ![:polymorphic] end |