Skip to content

Commit

Permalink
use labels instead of is_a? to determine whether nodes are of appropr…
Browse files Browse the repository at this point in the history
…iate type
  • Loading branch information
subvertallchris committed Jun 19, 2015
1 parent 05378f2 commit 5e3deb9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/neo4j/active_node/query/query_proxy.rb
Expand Up @@ -192,7 +192,7 @@ def _nodeify!(*args)
(arg.is_a?(Integer) || arg.is_a?(String)) ? @model.find_by(@model.id_property_name => arg) : arg
end.compact

if @model && other_nodes.any? { |other_node| !other_node.is_a?(@model) }
if @model && other_nodes.any? { |other_node| !other_node.class.mapped_label_names.include?(@model.mapped_label_name) }
fail ArgumentError, "Node must be of the association's class when model is specified"
end

Expand Down

0 comments on commit 5e3deb9

Please sign in to comment.