Firsthand Web Development, Ruby on Rails, Montréal

All things Ruby on Rails, Content Management Systems and Web Development

Showing posts with label active-record. Show all posts
Showing posts with label active-record. Show all posts
Tuesday, July 26, 2011

Run a SQL query within Ruby on Rails

›
ActiveRecord::Base.connection.execute(your_sql_statement)
Friday, October 22, 2010

Rail's ActiveRecord: include vs join

›
Confused when to use the :include vs. :join option? Remember these points: join does not load the association into association include doe...
Thursday, October 21, 2010

ActiveRecord::Base#becomes

›
An ActiveRecord method I did not existed: becomes . Returns an instance of the specified klass with the attributes of the current record. Th...
Wednesday, September 15, 2010

Custom default attribute in ActiveRecord

›
When I need a default value for a ActiveRecord attribute often I will resort to using a plugin. But in reality, initializing an attribute in...
Saturday, September 11, 2010

How to get the options for a named_scope

›
class Video "score DESC, id" end Video.highest_scores.proxy_options # => {:order=>"score DESC, id"}
Wednesday, September 8, 2010

Class Methods Called Against Associations in Active Record

›
Did you know you can call class methods against associations? Admittedly this is a trivial example, but here goes: Class methods also work ...
›
Home
View web version
Powered by Blogger.