aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/models/college.rb
Commit message (Collapse)AuthorAgeFilesLines
* Fix error when using `with_options` with lambda.Lauro Caetano2014-04-031-0/+5
| | | | | | | | | | | | | | | | | | | It was causing error when using `with_options` passing a lambda as its last argument. 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: https://github.com/rails/rails/blob/master/activesupport/test/option_merger_test.rb#L69 the method will only accept the lambda, this way it will keep the expected behavior. See 9eaa0a34
* added test for #3732Rick Martinez2012-02-101-0/+5