Support both Ruby 1.8 and Rails 3.1 syntaxes