diff options
-rw-r--r-- | actionpack/lib/action_controller/routing.rb | 2 | ||||
-rwxr-xr-x | activerecord/lib/active_record/base.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/actionpack/lib/action_controller/routing.rb b/actionpack/lib/action_controller/routing.rb index edd4683f60..8260a7b04c 100644 --- a/actionpack/lib/action_controller/routing.rb +++ b/actionpack/lib/action_controller/routing.rb @@ -1216,7 +1216,7 @@ module ActionController opts = if args.empty? || Hash === args.first args.first || {} else - options = args.last.is_a?(Hash) ? args.pop : {} + options = args.extract_options! args = args.zip(#{route.segment_keys.inspect}).inject({}) do |h, (v, k)| h[k] = v h diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index 337f68ba08..5aba0f060a 100755 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -1487,7 +1487,7 @@ module ActiveRecord #:nodoc: self.class_eval %{ def self.#{method_id}(*args) - options = args.last.is_a?(Hash) ? args.pop : {} + options = args.extract_options! attributes = construct_attributes_from_arguments([:#{attribute_names.join(',:')}], args) finder_options = { :conditions => attributes } validate_find_options(options) |