Locally Im developing using SQLite, but PostgreSQL is running on my working host Im. Locally, everything is fine, but not so on the host.
I created a search form with which I can evaluate all the data in my database with any similar combination. This seems to work fine until I use boolean and / or date fields. PostgreSQL doesn't really like my code ...
So here is a sample code:
unless params[:analysis][:sporty].blank? tmp_conditions_customer << ["(sporty ILIKE ?)", "%#{params[:analysis][:sporty]}%"] end
It is rated as
SELECT COUNT(*) FROM "customers" WHERE ((sporty ILIKE '%%')
What is that so? Why is "%%"?
To test Im deployment using Heroku with an Exceptional plugin. This plugin gives me the following hint:
HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.
Thanks. Exceptionally, but what does this mean?: - D The cast type for SQL queries? Do you want to work?
In my migration, the database field looks like this:
t.boolean :sporty
And in the form in which Im creates this data Im using this code
<%= f.label :sporty %><br /> <%= f.select :sporty, options_for_select({ "Ja" => true, "Nein" => false }), { :include_blank => '-----'} %>
As I mentioned, SQLite is my friend, it seems to be a much more rigorous evaluation of PostgreSQL, which is causing problems.
Thanks for your help in advance.