diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2009-05-18 21:27:42 +0200 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2009-05-18 21:27:42 +0200 |
commit | c5e109bbe766b0407a909361f18d2b87e9bfc75c (patch) | |
tree | 1030269e4b93c0bff66a08e7bbdd27a1d0472ac7 /activerecord/lib/active_record/base.rb | |
parent | 5e190ef138a034bf86419ce4f4c343ae16bfc77b (diff) | |
download | rails-c5e109bbe766b0407a909361f18d2b87e9bfc75c.tar.gz rails-c5e109bbe766b0407a909361f18d2b87e9bfc75c.tar.bz2 rails-c5e109bbe766b0407a909361f18d2b87e9bfc75c.zip |
Make sure default_scope#create checks for options[:conditions] [#2181 state:resolved] [James Le Cuirot]
Diffstat (limited to 'activerecord/lib/active_record/base.rb')
-rwxr-xr-x | activerecord/lib/active_record/base.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index ca4f4fa6b6..968b9bde5a 100755 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -2176,7 +2176,7 @@ module ActiveRecord #:nodoc: # default_scope :order => 'last_name, first_name' # end def default_scope(options = {}) - self.default_scoping << { :find => options, :create => (options.is_a?(Hash) && options.has_key?(:conditions)) ? options[:conditions] : {} } + self.default_scoping << { :find => options, :create => options[:conditions].is_a?(Hash) ? options[:conditions] : {} } end # Test whether the given method and optional key are scoped. |