Active Record model stinks when you start using multi monster joins so you got to stick with the old sql skills
something like ActiveRecord::Base.connection.select_all("select id from restaurants order by popularity limit 100")
and this will help even when at the same time when heroku rake db:migrate fails
what to do ?
$heroku consoleand start writing sexy sql statements like
>> ActiveRecord::Base.connection.select_all("ALTER TABLE xxx ADD COLUMN xxx_id integer") >> ActiveRecord::Base.connection.select_all("select xxx_id from xxx order by xxx_id limit 100")
No comments:
Post a Comment