Intridea Blog: Technology, Design, Business

Back to Blog

Get in Touch

You're currently viewing posts tagged with: "ActiveRecord"

Define Custom Callbacks for ActiveRecord and More

By Jerry Cheung | March 22, 2012 ActiveRecord, callbacks, activesupport

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.

Read more…

Fun with Ruby: Get All Nancy Drew on Chrome

By Jerry Cheung | February 2, 2011 ruby, ActiveRecord, search, 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.

Read more…

Quick Tip: Readable Conditional Validations in Rails

Temporarily disable ActiveRecord callbacks

By Brent Collier | March 12, 2009 ActiveRecord, callbacks

Easily Search on ActiveRecord Attributes

By Raymond Law | March 9, 2009 rails, ruby, plugins, ActiveRecord, rubyonrails, search

From Param: How URL-Based Fetching Ought to Be

Codebite: Generic "New Today" for Rails Records

ActiveRecord::Base.create_or_update on Steroids