Method: Mongoid::Relations::Accessors#create_relation
- Defined in:
- lib/mongoid/relations/accessors.rb
#create_relation(object, metadata) ⇒ Proxy
Create a relation from an object and metadata.
41 42 43 44 45 |
# File 'lib/mongoid/relations/accessors.rb', line 41 def create_relation(object, ) type = @attributes[.inverse_type] target = .builder(self, object).build(type) target ? .relation.new(self, target, ) : nil end |