aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/option_merger.rb
diff options
context:
space:
mode:
authorLawrence Pit <lawrence.pit@gmail.com>2008-07-14 11:53:41 +1000
committerPratik Naik <pratiknaik@gmail.com>2008-07-17 01:59:08 +0100
commit40dbebba28bfa1c55737da7354542c3bdca4e1a1 (patch)
treef21c9a31379dae25b5cedae5ea00053a272d9408 /activesupport/lib/active_support/option_merger.rb
parentcd6301557005617583e3f9ca5fb56297adcce7cc (diff)
downloadrails-40dbebba28bfa1c55737da7354542c3bdca4e1a1.tar.gz
rails-40dbebba28bfa1c55737da7354542c3bdca4e1a1.tar.bz2
rails-40dbebba28bfa1c55737da7354542c3bdca4e1a1.zip
Allow deep merging of hash values for nested with_options. [#490 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
Diffstat (limited to 'activesupport/lib/active_support/option_merger.rb')
-rw-r--r--activesupport/lib/active_support/option_merger.rb10
1 files changed, 1 insertions, 9 deletions
diff --git a/activesupport/lib/active_support/option_merger.rb b/activesupport/lib/active_support/option_merger.rb
index 1a4ff9db9a..c77bca1ac9 100644
--- a/activesupport/lib/active_support/option_merger.rb
+++ b/activesupport/lib/active_support/option_merger.rb
@@ -10,16 +10,8 @@ module ActiveSupport
private
def method_missing(method, *arguments, &block)
- merge_argument_options! arguments
+ arguments << (arguments.last.respond_to?(:to_hash) ? @options.deep_merge(arguments.pop) : @options.dup)
@context.send!(method, *arguments, &block)
end
-
- def merge_argument_options!(arguments)
- arguments << if arguments.last.respond_to? :to_hash
- @options.merge(arguments.pop)
- else
- @options.dup
- end
- end
end
end