aboutsummaryrefslogtreecommitdiffstats
path: root/guides/source/routing.md
diff options
context:
space:
mode:
authorsuginoy <suginoyasuhiro@gmail.com>2016-07-15 01:12:53 +0900
committersuginoy <suginoyasuhiro@gmail.com>2016-07-19 10:19:59 +0900
commitcf2574b1c9921377cbb5c7da38433b90fdc4a68c (patch)
tree91abd59035e79f05407026ede4da4bb8fb26823d /guides/source/routing.md
parentc02f3ea5e31677e7953abee5a1a2d5398d85ad47 (diff)
downloadrails-cf2574b1c9921377cbb5c7da38433b90fdc4a68c.tar.gz
rails-cf2574b1c9921377cbb5c7da38433b90fdc4a68c.tar.bz2
rails-cf2574b1c9921377cbb5c7da38433b90fdc4a68c.zip
Fix the calling `merge` method at first in a scope
Changing the order of method chaining `merge` and other query method such as `joins` should produce the same result. ```ruby class Topic < ApplicationRecord scope :safe_chaininig, -> { joins(:comments).merge(Comment.newest) } scope :unsafe_chaininig, -> { merge(Comment.newest).joins(:comments) } #=> NoMethodError end ```
Diffstat (limited to 'guides/source/routing.md')
0 files changed, 0 insertions, 0 deletions