lib/neo4j/active_node/has_n.rb in neo4j-7.1.0 vs lib/neo4j/active_node/has_n.rb in neo4j-7.1.1

- old
+ new

@@ -107,19 +107,26 @@ @cached_result = nil @query_proxy.public_send(:replace_with, *args) end - QUERY_PROXY_METHODS = [:<<, :delete, :create] + QUERY_PROXY_METHODS = [:<<, :delete, :create, :pluck, :where, :where_not, :rel_where, :rel_order, :order, :skip, :limit] + + QUERY_PROXY_METHODS.each do |method| + define_method(method) do |*args, &block| + @query_proxy.public_send(method, *args, &block) + end + end + CACHED_RESULT_METHODS = [] def method_missing(method_name, *args, &block) target = target_for_missing_method(method_name) super if target.nil? cache_query_proxy_result if !cached? && !target.is_a?(Neo4j::ActiveNode::Query::QueryProxy) - clear_cache_result if !QUERY_PROXY_METHODS.include?(method_name) && target.is_a?(Neo4j::ActiveNode::Query::QueryProxy) + clear_cache_result if target.is_a?(Neo4j::ActiveNode::Query::QueryProxy) target.public_send(method_name, *args, &block) end def serializable_hash(options = {}) @@ -128,11 +135,9 @@ private def target_for_missing_method(method_name) case method_name - when *QUERY_PROXY_METHODS - @query_proxy when *CACHED_RESULT_METHODS @cached_result else if @cached_result && @cached_result.respond_to?(method_name) @cached_result