I have put up an app on Heroku that is running fine locally (using sqlite3 as the gem for the database in testing), and when I push to Heroku and try to run it I keep getting this error:
ActiveRecord::StatementInvalid (PG::Error: ERROR: syntax error at or near "order"
LINE 1: ...lery_url_id = 'k19fv2mytjEb_3gCezLeRA') ORDER BY `order` ASC ^
: SELECT "pictures".* FROM "pictures" WHERE (gallery_url_id = 'k19fv2mytjEb_3gCezLeRA') ORDER BY `order` ASC):
app/controllers/galleries_controller.rb:38:in `show'
Specifically on this line:
@pictures = Picture.find(:all, :conditions => [ 'gallery_url_id = ?', @gallery.url_id ], :order => "`order` ASC")
NOTE: order is a database field, not a SQL call or reference. So don't go telling me I am doing two orders. That would be silly. Unless somehow it is being parsed that way. Which would also be silly.
I understand that it is some issue from using SQLite in the local testing and PostgreSQL (pg) in the production environment. My question is what do I need to do to fix this? Is it due to a flag that I call in the find that is only supported by SQLite and not PostgreSQL?