Class: DataMapper::Associations::RelationshipChain

Inherits:
Object
  • Object
show all
Defined in:
lib/autumn/datamapper_hacks.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#near_relationshipObject

:nodoc:



177
178
179
# File 'lib/autumn/datamapper_hacks.rb', line 177

def near_relationship
  parent_model.relationships(repository.name)[@near_relationship_name]
end

#remote_relationshipObject



181
182
183
184
185
# File 'lib/autumn/datamapper_hacks.rb', line 181

def remote_relationship
  return nil unless near_relationship
  near_relationship.child_model.relationships(repository.name)[@remote_relationship_name] ||
    near_relationship.child_model.relationships(repository.name)[@remote_relationship_name.to_s.singularize.to_sym]
end