rails/rails — pull request #14572 by laurocaetano (2014-04-02 22:51:43+00:00)
Title: Fix error when using `with_options` with lambda.

It was causing error when using `with_options` passing a lambda as its
last argument.

```ruby
class User < ActiveRecord::Base
with_options dependent: :destroy do |assoc|
assoc.has_many :profiles, -> { where(active: true) }
end
end
```

It was happening because the `option_merger` was taking the last
argument and checking if it was a Hash. This breaks the HasMany usage,
because its last argument can be a Hash or a Proc.

As the behavior described [in this test] [1], the method will only accept the lambda, this way it will keep the expected behavior. See 9eaa0a34

[1]: https://github.com/rails/rails/blob/master/activesupport/test/option_merger_test.rb#L69

Fixes #9805