Class: ActiveResource::Associations::Builder::BelongsTo
- Inherits:
-
Association
- Object
- Association
- ActiveResource::Associations::Builder::BelongsTo
- Defined in:
- lib/active_resource/associations/builder/belongs_to.rb
Instance Method Summary collapse
Instance Method Details
#build ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/active_resource/associations/builder/belongs_to.rb', line 7 def build = .delete(:embed) reflection = model.create_reflection(self.class.macro, name, ) model.defines_belongs_to_finder_method(reflection.name, reflection.klass, reflection.foreign_key) model.(reflection.name, reflection.klass, reflection.foreign_key) if return reflection end |