Module: RPCMapper::Associations::External::ClassMethods
- Defined in:
- lib/rpc_mapper/associations/external.rb
Instance Method Summary collapse
- #belongs_to(id, options = {}) ⇒ Object
- #has_many(id, options = {}) ⇒ Object
- #has_one(id, options = {}) ⇒ Object
Instance Method Details
#belongs_to(id, options = {}) ⇒ Object
9 10 11 |
# File 'lib/rpc_mapper/associations/external.rb', line 9 def belongs_to(id, ={}) create_external_association RPCMapper::Association::BelongsTo.new(self, id, ) end |
#has_many(id, options = {}) ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'lib/rpc_mapper/associations/external.rb', line 17 def has_many(id, ={}) klass = if .include?(:through) RPCMapper::Association::HasManyThrough else RPCMapper::Association::HasMany end create_external_association klass.new(self, id, ) end |
#has_one(id, options = {}) ⇒ Object
13 14 15 |
# File 'lib/rpc_mapper/associations/external.rb', line 13 def has_one(id, ={}) create_external_association RPCMapper::Association::HasOne.new(self, id, ) end |