default_scopeはunscopedで外す。
2010 年 11 月 14 日
with_exclusive_scope (ActiveRecord::Base) – APIdock
In Rails3 use "unscoped" instead
The with_exclusive_scope examples no longer work in Rails3 because with_exclusive_scope is now a protected method which can and should not be used in a controller. Use the new unscoped method instead:
ほー。
class Post < ActiveRecord::Base
default_scope :published => true
end
Post.all #=> SELECT * FROM posts WHERE published = true
Post.unscoped.all #=> SELECT * FROM posts
ほほー。