Machinist2和脏跟踪

时间:2012-01-12 09:00:48

标签: ruby-on-rails-3.1 rails-3.1 machinist

不幸的是,似乎Machinist与Active Record合作以某种方式绕过了脏跟踪。虽然我有基于after_save回调的测试,但是必须明确设置被跟踪的属性,否则tracked_changed?返回false ...有人有经验吗?

# in after_save tracked_changed? returns false
client = Client.make!(:tracked => "AAA")


# in after_save tracked_changed? returns true
client = Client.make!
client.tracked = "XXX"
client.save

0 个答案:

没有答案