diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-10-19 17:27:50 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-10-19 17:29:25 -0700 |
commit | d2898d4ef80dc74ef0d6204b5c7f50877659e50e (patch) | |
tree | 1b1744f416f4ec6030833a573a966ca1ada58e5b /activerecord/lib/active_record | |
parent | 56be4c897ae52d73583c51dec155e6161e3dc900 (diff) | |
download | rails-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')
-rw-r--r-- | activerecord/lib/active_record/named_scope.rb | 2 |
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) |