When to :select and :include your rubies and rails

April 6, 2009

Although plugins exist to force :select and :include to play nice with ActiveRecord::Base.find, using this approach does not always yield the best performance. The post discusses when to use eager loading and when to use other approaches and the plugins that will help you.

0

Eager loading Select Plugin: when :select plays nice with :include

March 26, 2009

eload-select plugin. Allowing :select to play nice with :include for Ruby on Rails ActiveRecord finders.

2

Aliasing MySQL Functions with ActiveRecord

January 31, 2009

Changing column data to use MySQL functions instead of the actual column data for Ruby on Rails ActiveRecord is simple. To allow ActiveRecord to retrieve the data of the function,  alias it to the column name. Event.find :all, :select => ‘substring(name, 1, 10) as name’ This produces the follow SQL query using MySQL SUBSTRING function: [...]

0