lib/neo4j/active_node/has_n.rb in neo4j-9.3.0 vs lib/neo4j/active_node/has_n.rb in neo4j-9.4.0
- old
+ new
@@ -237,31 +237,30 @@
def previous_proxy_results_by_previous_id(result_cache, association_name)
query_proxy = self.class.as(:previous).where(neo_id: result_cache.map(&:neo_id))
query_proxy = self.class.send(:association_query_proxy, association_name, previous_query_proxy: query_proxy, node: :next, optional: true)
- Hash[*query_proxy.pluck('ID(previous)', 'collect(next)').flatten(1)].each do |_, records|
+ Hash[*query_proxy.pluck('ID(previous)', 'collect(next)').flatten(1)].each_value do |records|
records.each do |record|
record.instance_variable_set('@source_proxy_result_cache', records)
end
end
end
# rubocop:disable Metrics/ModuleLength
module ClassMethods
- # rubocop:enable Style/PredicateName
- # rubocop:disable Style/PredicateName
+ # rubocop:disable Naming/PredicateName
# :nocov:
def has_association?(name)
ActiveSupport::Deprecation.warn 'has_association? is deprecated and may be removed from future releases, use association? instead.', caller
association?(name)
end
# :nocov:
- # rubocop:enable Style/PredicateName
+ # rubocop:enable Naming/PredicateName
def association?(name)
!!associations[name.to_sym]
end
@@ -358,11 +357,11 @@
#
# *dependent*: Enables deletion cascading.
# **Available values:** ``:delete``, ``:delete_orphans``, ``:destroy``, ``:destroy_orphans``
# (note that the ``:destroy_orphans`` option is known to be "very metal". Caution advised)
#
- def has_many(direction, name, options = {}) # rubocop:disable Style/PredicateName
+ def has_many(direction, name, options = {}) # rubocop:disable Naming/PredicateName
name = name.to_sym
build_association(:has_many, direction, name, options)
define_has_many_methods(name, options)
end
@@ -375,11 +374,11 @@
# This would define the methods: ``#vehicle``, ``#vehicle=``, and ``.vehicle``.
#
# See :ref:`#has_many <Neo4j/ActiveNode/HasN/ClassMethods#has_many>` for anything
# not specified here
#
- def has_one(direction, name, options = {}) # rubocop:disable Style/PredicateName
+ def has_one(direction, name, options = {}) # rubocop:disable Naming/PredicateName
name = name.to_sym
build_association(:has_one, direction, name, options)
define_has_one_methods(name, options)
end
@@ -576,7 +575,8 @@
def duplicate_association?(name)
associations.key?(name) && parent_associations[name] != associations[name]
end
end
+ # rubocop:enable Metrics/ModuleLength
end
end