1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activerecord/test/schema
Lauro Caetano db5d26c9d7 Fix error when using with_options with lambda.
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
2014-04-03 10:26:37 -03:00
..
mysql2_specific_schema.rb fix detect column type of enum 2013-04-01 17:09:20 +09:00
mysql_specific_schema.rb fix detect column type of enum 2013-04-01 17:09:20 +09:00
oracle_specific_schema.rb Do not create synonym named subjects 2013-11-27 23:43:51 +01:00
postgresql_specific_schema.rb register OID for PostgreSQL citex datatype [Troy Kruthoff & Lachlan Sylvester] 2014-03-11 08:14:03 +11:00
schema.rb Fix error when using with_options with lambda. 2014-04-03 10:26:37 -03:00
sqlite_specific_schema.rb Remove sqlite specificsupports_autoincrement? which always defaults to true 2013-08-10 22:21:25 +05:30