Skip to content

Instantly share code, notes, and snippets.

@gwright
Last active December 30, 2015 11:39
Show Gist options
  • Save gwright/7824064 to your computer and use it in GitHub Desktop.
Save gwright/7824064 to your computer and use it in GitHub Desktop.
3.2.12 - 3.2.16
Scopes that are
-- combined via #merge AND
-- are simple column/value equality tests
will be MERGED, last equality test wins.
Chained scopes don't always use merge:
-- explicit where clauses don't use merge (=> AND)
-- class methods (vs scopes) don't use merge ( => AND)
Chained scopes sometimes use merge:
-- scope references (vs class methods) use MERGE logic
-- an explicit merge, uses MERGE logic
An explicit merge will cause ALL chained relations to be merged (class, explicit, scope)
Model.a.merge(Model.c.d) # a.merge(c).merge(d)
4.0.0 and beyond
equality scopes are ONLY merged via an explicit use of merge
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment