Skip to content

Commit

Permalink
rename of has_n_relation.rb. RSpec describe .., filename and optional…
Browse files Browse the repository at this point in the history
…ly what class it tests should be the same [#19]
  • Loading branch information
andreasronge committed Jan 13, 2009
1 parent ae6d090 commit 65f36b2
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/neo4j.rb
Expand Up @@ -20,7 +20,7 @@
require 'neo4j/relations/relation_info'
require 'neo4j/relations/dynamic_relation'
require 'neo4j/relations/relations'
require 'neo4j/relations/has_n_relations'
require 'neo4j/relations/has_n'
require 'neo4j/relations/relation_traverser'
require 'neo4j/relations/node_traverser'

Expand Down
6 changes: 3 additions & 3 deletions lib/neo4j/mixins/node.rb
Expand Up @@ -588,12 +588,12 @@ def index_relation(index_key, rel_type, prop)
def has_one(rel_type)

module_eval(%Q{def #{rel_type}=(value)
r = Relations::HasNRelations.new(self,'#{rel_type.to_s}')
r = Relations::HasN.new(self,'#{rel_type.to_s}')
r << value
end}, __FILE__, __LINE__)

module_eval(%Q{def #{rel_type}
r = Relations::HasNRelations.new(self,'#{rel_type.to_s}')
r = Relations::HasN.new(self,'#{rel_type.to_s}')
r.to_a[0]
end}, __FILE__, __LINE__)
relations_info[rel_type] = Relations::RelationInfo.new
Expand All @@ -611,7 +611,7 @@ def has_one(rel_type)
# :api: public
def has_n(rel_type)
module_eval(%Q{def #{rel_type}(&block)
Relations::HasNRelations.new(self,'#{rel_type.to_s}', &block)
Relations::HasN.new(self,'#{rel_type.to_s}', &block)
end}, __FILE__, __LINE__)
relations_info[rel_type] = Relations::RelationInfo.new
end
Expand Down
3 changes: 2 additions & 1 deletion lib/neo4j/relations/dynamic_relation.rb
@@ -1,10 +1,11 @@
module Neo4j
module Relations
#

# Provides dynamic property accessors.
# Use this as a mixin if you do not want to declare what properties a Relationship has.
# Wrapper class for a java org.neo4j.api.core.Relationship class
#
# :api: public
class DynamicRelation
extend Neo4j::TransactionalMixin
include Neo4j::RelationMixin
Expand Down
Expand Up @@ -5,7 +5,7 @@ module Relations
# Used for traversing relationship of a specific type.
# Neo4j::NodeMixin can declare
#
class HasNRelations
class HasN
include Enumerable
extend Neo4j::TransactionalMixin

Expand Down

0 comments on commit 65f36b2

Please sign in to comment.