aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/named_scope.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2010-10-19 17:27:50 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2010-10-19 17:29:25 -0700
commitd2898d4ef80dc74ef0d6204b5c7f50877659e50e (patch)
tree1b1744f416f4ec6030833a573a966ca1ada58e5b /activerecord/lib/active_record/named_scope.rb
parent56be4c897ae52d73583c51dec155e6161e3dc900 (diff)
downloadrails-d2898d4ef80dc74ef0d6204b5c7f50877659e50e.tar.gz
rails-d2898d4ef80dc74ef0d6204b5c7f50877659e50e.tar.bz2
rails-d2898d4ef80dc74ef0d6204b5c7f50877659e50e.zip
scopes can take an object that responds to `call`
Diffstat (limited to 'activerecord/lib/active_record/named_scope.rb')
-rw-r--r--activerecord/lib/active_record/named_scope.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/named_scope.rb b/activerecord/lib/active_record/named_scope.rb
index b767a2b4a8..0b92ba5caa 100644
--- a/activerecord/lib/active_record/named_scope.rb
+++ b/activerecord/lib/active_record/named_scope.rb
@@ -104,7 +104,7 @@ module ActiveRecord
extension = Module.new(&Proc.new) if block_given?
scopes[name] = lambda do |*args|
- options = scope_options.is_a?(Proc) ? scope_options.call(*args) : scope_options
+ options = scope_options.respond_to?(:call) ? scope_options.call(*args) : scope_options
relation = if options.is_a?(Hash)
scoped.apply_finder_options(options)