Permalink
Browse files

on tests: dont always touch firm on validate

  • Loading branch information...
1 parent fdc3c08 commit e1bb9fc671a8d33fb70f94f094bc5644e9c81a18 @arthurnn arthurnn committed Sep 25, 2013
@@ -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
@@ -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

0 comments on commit e1bb9fc

Please sign in to comment.