aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
authorMarcel Molina <marcel@vernix.org>2005-10-06 22:21:10 +0000
committerMarcel Molina <marcel@vernix.org>2005-10-06 22:21:10 +0000
commite8b427cdefd9ec851e2853d4bf21dd8fd676096d (patch)
tree7aae75a60ff2fb3dfa62dbcedd21d4d216684abf /activerecord/lib/active_record
parentbcb50f3c893e070caa3abf06bee03885f1601190 (diff)
downloadrails-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/active_record')
-rwxr-xr-xactiverecord/lib/active_record/base.rb8
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)