diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2018-11-30 21:41:12 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-30 21:41:12 +0900 |
commit | 5c6316dbb88075e27169f49a22e59357efd1a967 (patch) | |
tree | fb78cb1a719c36c7ee40c28882f41397f152c425 /activerecord/test/models | |
parent | faf91b0db432d6b9dc820c060ccce0b3d10d7daa (diff) | |
parent | 3090b358482942b944e5944c4869d2bf1afdefb8 (diff) | |
download | rails-5c6316dbb88075e27169f49a22e59357efd1a967.tar.gz rails-5c6316dbb88075e27169f49a22e59357efd1a967.tar.bz2 rails-5c6316dbb88075e27169f49a22e59357efd1a967.zip |
Merge pull request #34572 from kamipo/fix_scoping_with_query_method
Fix the scoping with query methods in the scope block
Diffstat (limited to 'activerecord/test/models')
-rw-r--r-- | activerecord/test/models/post.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/activerecord/test/models/post.rb b/activerecord/test/models/post.rb index 710a75ad30..e32cc59399 100644 --- a/activerecord/test/models/post.rb +++ b/activerecord/test/models/post.rb @@ -254,6 +254,7 @@ class SpecialPostWithDefaultScope < ActiveRecord::Base self.table_name = "posts" default_scope { where(id: [1, 5, 6]) } scope :unscoped_all, -> { unscoped { all } } + scope :authorless, -> { unscoped { where(author_id: 0) } } end class PostThatLoadsCommentsInAnAfterSaveHook < ActiveRecord::Base |