forked from neo4jrb/activegraph
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Using the @option tag to document options
typo fix Rubocop Extracting Cypher-related methods into their own modules Testing the different possible values for the `:rel_length` option and the generated Cypher when used with other relationship options End-to-end tests for has_many queries with variable-length relationships End-to-end tests for the has_one association Accept and transmit :rel_length option when querying an association * The association proxy cache should use queried :rel_length as a cache key to avoid returning incorrect results for queries that differ only by the given :rel_length value * `has_one` method now accepts options and, depending on the presence and type of the :rel_length option, will either return a collection or a single node This is the actual code that validates and makes use of the :rel_length option to allow variable-length relationships queries Updating tests to allow for a Hash representation of relationships variable-length qualifiers: {min: 0, max: 2} will be translated to `*0..2` whereas omitting `:min` or `:max` will simply translate to "open-ended" ranges. Implement changes to the variable-length relationships feature to allow for a Hash representation of ranges, thus providing an easy way to specify open-ended bounds. Consequently, the `:none_or_more` Symbol has been removed as it felt more like a "patch" than part of the feature I have taken the liberty to increase (+1) the maximum allowed Cyclomatic complexity as, to me, there's no satisfying way to reduce the Cyclomatic complexity of AssociationCypherMethods#validate_rel_length Updating tests to allow for a single parameter (an options hash) in calls to `has_(one|many)` methods (+ fixed rubocop offense) Implementation for tests allowing the use of a single argument in calls to `has_(one|many)` getter methods Typo Adding doc about queries with variable-length relationships An additional note on variable-length rels with `has_one` associations Docs: reference tutorial doc on : rel_length option Removing maximum allowed Cyclomatic Complexity increase * Refactoring rel_length validation to call `fail` from a single point and only create error messages in the other methods. * Most checks have been extracted to their own methods to bring the cyclomatic and perceived complexity of each method below the default accepted maximums Fixed tests to match new error messages from refactoring Updated doc files
- Loading branch information
Showing
26 changed files
with
717 additions
and
149 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.