diff options
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) |