diff options
author | Marcel Molina <marcel@vernix.org> | 2005-10-06 22:21:10 +0000 |
---|---|---|
committer | Marcel Molina <marcel@vernix.org> | 2005-10-06 22:21:10 +0000 |
commit | e8b427cdefd9ec851e2853d4bf21dd8fd676096d (patch) | |
tree | 7aae75a60ff2fb3dfa62dbcedd21d4d216684abf /activerecord/lib | |
parent | bcb50f3c893e070caa3abf06bee03885f1601190 (diff) | |
download | rails-e8b427cdefd9ec851e2853d4bf21dd8fd676096d.tar.gz rails-e8b427cdefd9ec851e2853d4bf21dd8fd676096d.tar.bz2 rails-e8b427cdefd9ec851e2853d4bf21dd8fd676096d.zip |
Raise an exception when invalid options are passed to ActiveRecord::Base.find. Closes #2363.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2481 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/lib')
-rwxr-xr-x | activerecord/lib/active_record/base.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index 1c063c003d..8d7a49e46b 100755 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -975,7 +975,13 @@ module ActiveRecord #:nodoc: end def extract_options_from_args!(args) - if args.last.is_a?(Hash) then args.pop else {} end + options = args.last.is_a?(Hash) ? args.pop : {} + validate_find_options(options) + options + end + + def validate_find_options(options) + options.assert_valid_keys [:conditions, :include, :joins, :limit, :offset, :order, :select] end def encode_quoted_value(value) |