I moved my app from sqlite to postgresql so that I could use RGeo and PostGIS. I deleted all the data in my database and started from scratch. Everything is working fine except one particular area of the site. I have an association that links Tourstops and Venues that appears to be not working. No code was modified in this area since the switch. Unfortunately I'm still sort of new to rails and don't know enough to diagnose this error.
The error I'm getting is:
ActiveRecord::StatementInvalid in ToursController#show
PG::DatatypeMismatch: ERROR: argument of WHERE must be type boolean, not type integer LINE 1: SELECT "venues".* FROM "venues" WHERE (1) LIMIT 1 ^ : SELECT "venues".* FROM "venues" WHERE (1) LIMIT 1
def show
@tour = Tour.find(params[:id])
@tourstop = Venue.find_by(params[:id])
end
Parameters: {"id"=>"1"}
find_by
is an actual ActiveRecord method (at least not with just an id as a parameter) – Antoine Jan 27 '14 at 15:25Article.find_by({name: "Hello"
}) – Rich Peck Jan 28 '14 at 10:21