Closed yourpalal closed 8 months ago
BTW, CI failed due to rubocop issues:
Offenses:
lib/neo4j/active_node/has_n.rb:212:5: C: Metrics/AbcSize: Assignment Branch Condition size for association_proxy is too high. [18.06/18] (http://c2.com/cgi/wiki?AbcMetric)
def association_proxy(name, options = {}) ...
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lib/neo4j/active_node/has_n.rb:212:5: C: Metrics/MethodLength: Method has too many lines. [17/15] (https://github.com/bbatsov/ruby-style-guide#short-methods)
def association_proxy(name, options = {}) ...
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2 lines too many and 0.06 too many ABC points :/ I guess splitting into 2 methods would do better?
Clean up and comment the HashN#association_proxy method which was pretty convoluted. Functionally equivalent to #1530, so this is a style-only fix, once that PR has been merged.
hash
variable toproxy_hash_key
cache
variable toassociation_query_results
Technically, this also fixes #1529, but there is another PR that fixes it with a smaller change (#1530)