ActiveModel Callbacks in Sandra

visibility 21 views schedule 14 years ago timer 8:13
open_in_new Dailymotion
For my Jot class in JotRod, I want the jot to set a hash of some kind as the key when it gets saved. This is the perfect scenario for using ActiveModels' callbacks functionality.<br /><br />It only took a few minutes to get set up, but works great! Now I have a key set up whenever I try saving a Jot.