lib/neo4j/active_rel/query.rb in neo4j-5.2.15 vs lib/neo4j/active_rel/query.rb in neo4j-6.0.0.alpha.1
- old
+ new
@@ -39,15 +39,21 @@
all_query.limit(1).order('ID(r1) DESC').pluck(:r1).first
end
private
+ def deprecation_warning!
+ ActiveSupport::Deprecation.warn 'The Neo4j::ActiveRel::Query module has been deprecated and will be removed in a future version of the gem.', caller
+ end
+
def where_query
+ deprecation_warning!
Neo4j::Session.query.match("#{cypher_string(:outbound)}-[r1:`#{self._type}`]->#{cypher_string(:inbound)}")
end
def all_query
+ deprecation_warning!
Neo4j::Session.query.match("#{cypher_string}-[r1:`#{self._type}`]->#{cypher_string(:inbound)}")
end
def cypher_string(dir = :outbound)
case dir
@@ -69,9 +75,11 @@
case given_class
when String
given_class.constantize
when Symbol
given_class.to_s.constantize
+ when Array
+ fail "ActiveRel query methods are being deprecated and do not support Array (from|to)_class options. Current value: #{given_class}"
else
given_class
end
end