Rails ActiveRecord models have a lifecycle that developers are allowed to hook into. But while most of us know about before_save and after_update, there are a few lesser unknown callbacks that are good to know about before you reinvent them. In this post, I'll cover all of the available ActiveRecord lifecycle callbacks, and also show how you can define custom callbacks for normal ruby objects.
Intridea Blog: Technology, Design, Business
Back to Blog
Get in TouchYou're currently viewing posts tagged with: "ActiveRecord"
Define Custom Callbacks for ActiveRecord and More
Fun with Ruby: Get All Nancy Drew on Chrome
I use the Chrome history tab when I forget about
something I've looked up in the past. I initially thought that the data would
be stored in a CSV or XML file and thought I could do some string munging for
kicks and giggles. To my delight, when I looked in the "Application Support"
directory for Chrome, I found several data-rich sqlite databases ready for
mining. With a few Ruby tricks, I found some cool data. All the code this article
covers is available on the chrome_spy project.