<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -10,7 +10,13 @@ module ActiveSupport
 
     private
       def method_missing(method, *arguments, &amp;block)
-        arguments &lt;&lt; (arguments.last.respond_to?(:to_hash) ? @options.deep_merge(arguments.pop) : @options.dup)
+        if arguments.last.is_a?(Proc)
+          proc = arguments.pop
+          arguments &lt;&lt; lambda { |*args| @options.deep_merge(proc.call(*args)) }
+        else
+          arguments &lt;&lt; (arguments.last.respond_to?(:to_hash) ? @options.deep_merge(arguments.pop) : @options.dup)
+        end
+
         @context.__send__(method, *arguments, &amp;block)
       end
   end</diff>
      <filename>activesupport/lib/active_support/option_merger.rb</filename>
    </modified>
    <modified>
      <diff>@@ -64,6 +64,14 @@ class OptionMergerTest &lt; Test::Unit::TestCase
       end
     end
   end
+  
+  def test_nested_method_with_options_using_lamdba
+    local_lamdba = lambda { { :lambda =&gt; true } }
+    with_options(@options) do |o|
+      assert_equal @options.merge(local_lamdba.call),
+        o.method_with_options(local_lamdba).call
+    end
+  end
 
   # Needed when counting objects with the ObjectSpace
   def test_option_merger_class_method</diff>
      <filename>activesupport/test/option_merger_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>8d8195dc2443755786d3a8598b7c2da1f08a38e7</id>
    </parent>
  </parents>
  <author>
    <name>David Heinemeier Hansson</name>
    <email>david@loudthinking.com</email>
  </author>
  <url>http://github.com/rails/rails/commit/9eaa0a3449595d07fe2ada5c4c93ec226622147c</url>
  <id>9eaa0a3449595d07fe2ada5c4c93ec226622147c</id>
  <committed-date>2008-11-15T07:48:14-08:00</committed-date>
  <authored-date>2008-11-15T07:48:14-08:00</authored-date>
  <message>Added lambda merging to OptionMerger (especially useful with named_scope and with_options) [#740 state:committed] (Pawe&#322; Kondzior)</message>
  <tree>9bf645cc94377fcdc49846c1aadddf6b2dab0702</tree>
  <committer>
    <name>David Heinemeier Hansson</name>
    <email>david@loudthinking.com</email>
  </committer>
</commit>
