不幸的是,似乎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