Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #12364 from arthurnn/test_fix_validate

Fix query counters when testing with IdentityMap on 3.2
  • Loading branch information...
commit e82cecae351a514c87a05eeeabf55f6bdfb0f280 2 parents fdc3c08 + e1bb9fc
@rafaelfranca rafaelfranca authored
View
4 activerecord/test/cases/associations/has_many_associations_test.rb
@@ -656,7 +656,9 @@ def test_transactions_when_adding_to_new_record
def test_inverse_on_before_validate
firm = companies(:first_firm)
assert_queries(1) do
- firm.clients_of_firm << Client.new("name" => "Natural Company")
+ client = Client.new("name" => "Natural Company")
+ client.touch_firm_on_validate = true
+ firm.clients_of_firm << client
end
end
View
3  activerecord/test/models/company.rb
@@ -126,8 +126,9 @@ class Client < Company
has_many :accounts, :through => :firm
belongs_to :account
+ attr_accessor :touch_firm_on_validate
validate do
- firm
+ firm if touch_firm_on_validate
end
class RaisedOnSave < RuntimeError; end
Please sign in to comment.
Something went wrong with that request. Please try again.