aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/named_scope.rb
diff options
context:
space:
mode:
authorElijah Miller <elijah.miller@gmail.com>2009-03-12 15:06:19 +0000
committerPratik Naik <pratiknaik@gmail.com>2009-03-12 15:06:19 +0000
commit91b98cf0a5417ce4042a0b3cd1930d5a221b737f (patch)
tree625c8bdf652ca584fcadf6599e6eec13078ebb54 /activerecord/lib/active_record/named_scope.rb
parentaa57e66fec3a131f5d246b8950a2c3286f858b78 (diff)
downloadrails-91b98cf0a5417ce4042a0b3cd1930d5a221b737f.tar.gz
rails-91b98cf0a5417ce4042a0b3cd1930d5a221b737f.tar.bz2
rails-91b98cf0a5417ce4042a0b3cd1930d5a221b737f.zip
Returning nil from named scope lambda is equivalent to an empty hash [#1773 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
Diffstat (limited to 'activerecord/lib/active_record/named_scope.rb')
-rw-r--r--activerecord/lib/active_record/named_scope.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/named_scope.rb b/activerecord/lib/active_record/named_scope.rb
index 519941dd94..1f3ef300f2 100644
--- a/activerecord/lib/active_record/named_scope.rb
+++ b/activerecord/lib/active_record/named_scope.rb
@@ -117,6 +117,7 @@ module ActiveRecord
delegate :scopes, :with_scope, :to => :proxy_scope
def initialize(proxy_scope, options, &block)
+ options ||= {}
[options[:extend]].flatten.each { |extension| extend extension } if options[:extend]
extend Module.new(&block) if block_given?
unless Scope === proxy_scope