mirror of
https://github.com/github/rails.git
synced 2026-01-30 08:48:06 -05:00
Use extract_options! rather than Hash test + pop. Closes #10628 [ssoroka]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8496 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user