notahat / machinist

Fixtures aren't fun. Machinist is.
MIT License
1.12k stars 134 forks source link

Machinist2 and dirty tracking #105

Closed papricek closed 12 years ago

papricek commented 12 years ago

Unfortunately, it seems that Machinist in cooperation with Active Record somehow bypasses dirty tracking. While I have test based on after_save callback, the tracked attribute must be set explicitely, otherwise tracked_changed? returns false... Is that machinists intended behavior?

# 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
notahat commented 12 years ago

I just tried this, and it works correctly for me. You'll have to give me some runnable code that demonstrates the problem.