diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2008-11-15 12:21:04 -0800 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2008-11-15 12:21:04 -0800 |
commit | eeea1a26ec7bd5e11caa4630ff7820c1c7f762e3 (patch) | |
tree | 3b193dba9756b45e1a0a70d47faa4c3e2ff946a9 /activesupport/lib/active_support/option_merger.rb | |
parent | 1304b664924bfea54fd6dc0dc924ae3d126ff92d (diff) | |
parent | 4f984c9d0e66601a81cb5ae6e3b50582e6dc0c2d (diff) | |
download | rails-eeea1a26ec7bd5e11caa4630ff7820c1c7f762e3.tar.gz rails-eeea1a26ec7bd5e11caa4630ff7820c1c7f762e3.tar.bz2 rails-eeea1a26ec7bd5e11caa4630ff7820c1c7f762e3.zip |
Merge branch 'master' into testing
Diffstat (limited to 'activesupport/lib/active_support/option_merger.rb')
-rw-r--r-- | activesupport/lib/active_support/option_merger.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/option_merger.rb b/activesupport/lib/active_support/option_merger.rb index b563b093ed..63662b75c7 100644 --- a/activesupport/lib/active_support/option_merger.rb +++ b/activesupport/lib/active_support/option_merger.rb @@ -10,7 +10,13 @@ module ActiveSupport private def method_missing(method, *arguments, &block) - arguments << (arguments.last.respond_to?(:to_hash) ? @options.deep_merge(arguments.pop) : @options.dup) + if arguments.last.is_a?(Proc) + proc = arguments.pop + arguments << lambda { |*args| @options.deep_merge(proc.call(*args)) } + else + arguments << (arguments.last.respond_to?(:to_hash) ? @options.deep_merge(arguments.pop) : @options.dup) + end + @context.__send__(method, *arguments, &block) end end |