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: [...]


Conditional Page Cache

January 27, 2009

Do to some Obama day drama, I wrote a little plugin that allows you to conditionally page or action cache at runtime. This means that you might page cache depending on the user type, or the date or how you feel when you wake up. script/plugin install At the top of the controller, indicate [...]


MULTIMONGREL! Awesome Action Caching with Rails

January 23, 2009

Action Cache Plugin is super. Tweak it a little for use with multi mongrel environment!