aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
authorTim Morgan <tim@timmorgan.org>2010-10-14 22:31:05 -0500
committerAaron Patterson <aaron.patterson@gmail.com>2010-10-19 14:43:31 -0700
commitb1b26af9a2f1c2037f7c2167d747ed33cc639763 (patch)
tree218444ecb0115b77dcc023511d5ea99d0b440644 /activerecord/lib/active_record
parentd619b9d1d1ad8d7497bf24283b2318c056283f48 (diff)
downloadrails-b1b26af9a2f1c2037f7c2167d747ed33cc639763.tar.gz
rails-b1b26af9a2f1c2037f7c2167d747ed33cc639763.tar.bz2
rails-b1b26af9a2f1c2037f7c2167d747ed33cc639763.zip
Allow default_scope to accept a Proc.
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r--activerecord/lib/active_record/base.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb
index 78b3507dd9..879f02ff6a 100644
--- a/activerecord/lib/active_record/base.rb
+++ b/activerecord/lib/active_record/base.rb
@@ -1143,7 +1143,12 @@ MSG
end
def current_scoped_methods #:nodoc:
- scoped_methods.last
+ method = scoped_methods.last
+ if method.respond_to?(:call)
+ unscoped(&method)
+ else
+ method
+ end
end
def reset_scoped_methods #:nodoc: