From d2898d4ef80dc74ef0d6204b5c7f50877659e50e Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Tue, 19 Oct 2010 17:27:50 -0700 Subject: scopes can take an object that responds to `call` --- activerecord/lib/active_record/named_scope.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/lib') 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) -- cgit v1.2.3