title: Rails 3.1. Heroku PGError: operator does not exist: character varying = integer
body: <p>Having a little trouble fixing an error.</p>
  
  <p>All works great on local machine.
  On PG, heroku is the error.</p>
  
  <p>Here are the logs :</p>
  
  <pre><code>  ←[32m2012-01-09T19:52:24+00:00 app[web.1]:←[0m ActionView::Template::Error (PGEr
    ror: ERROR:  operator does not exist: character varying = integer
    ←[32m2012-01-09T19:52:24+00:00 app[web.1]:←[0m LINE 1: ...T "reviews".* FROM "re
    views"  WHERE "reviews"."trip_id" = 32
    ←[32m2012-01-09T19:52:24+00:00 app[web.1]:←[0m : SELECT "reviews".* FROM "review
    s"  WHERE "reviews"."trip_id" = 32):
    ←[32m2012-01-09T19:52:24+00:00 app[web.1]:←[0m     31:   &lt;div style='display:non
    e'&gt;
    ←[32m2012-01-09T19:52:24+00:00 app[web.1]:←[0m     33:      &lt;% for review in @tr
    ip.reviews %&gt;
    ←[32m2012-01-09T19:52:24+00:00 app[web.1]:←[0m     34:
    ←[32m2012-01-09T19:52:24+00:00 app[web.1]:←[0m     32:    &lt;div id="inline"&gt;
    ←[32m2012-01-09T19:52:24+00:00 app[web.1]:←[0m HINT:  No operator matches the gi
    ven name and argument type(s). You might need to add explicit type casts.
    ←[32m2012-01-09T19:52:24+00:00 app[web.1]:←[0m   app/controllers/trips_controlle
    r.rb:21:in `show'
    ←[32m2012-01-09T19:52:24+00:00 app[web.1]:←[0m
    ←[32m2012-01-09T19:52:24+00:00 app[web.1]:←[0m cache: [GET /trips/32] miss
    ←[32m2012-01-09T19:52:24+00:00 app[web.1]:←[0m     36:     &lt;li&gt; &lt;%= review.conte
    nt %&gt; &lt;/li&gt;
    ←[32m2012-01-09T19:52:24+00:00 app[web.1]:←[0m     35:     &lt;ul&gt;
    ←[32m2012-01-09T19:52:24+00:00 app[web.1]:←[0m
    ←[32m2012-01-09T19:52:24+00:00 app[web.1]:←[0m   app/views/trips/show.html.erb:3
    3:in `_app_views_trips_show_html_erb__3301405670044045300_69859019468960'
    ←[32m2012-01-09T19:52:24+00:00 app[web.1]:←[0m Completed 500 Internal Server Err
    or in 86ms
    ←[32m2012-01-09T19:52:24+00:00 app[web.1]:←[0m   Parameters: {"id"=&gt;"32"}
    ←[32m2012-01-09T19:52:24+00:00 app[web.1]:←[0m   Processing by TripsController#s
    how as HTML
    ←[32m2012-01-09T19:52:24+00:00 app[web.1]:←[0m Rendered trips/show.html.erb with
    in layouts/application (81.8ms)
  </code></pre>
  
  <p>Not really sure where exactly, the error occurs and how to fix it.</p>
  
  <p>reviews.rb</p>
  
  <pre><code> class Review &lt; ActiveRecord::Base
    belongs_to :trip
   end
  
   class Trip &lt; ActiveRecord::Base
    has_many :reviews, :dependent =&gt; :destroy
    attr_accessible, :reviews_attributes
  
    accepts_nested_attributes_for :reviews, :reject_if =&gt; lambda { |a| a[:name].blank? }, :allow_destroy =&gt; true
   end 
  </code></pre>
  
  <p>show.html.rb</p>
  
  <pre><code> &lt;%= link_to "Read Reviews", '#inline',  :id =&gt; 'various1', :class =&gt; 'review' %&gt;  
  
   &lt;div style='display:none'&gt;  
     &lt;div id="inline"&gt;
        &lt;% for review in @trip.reviews %&gt;  
         &lt;ul&gt;
           &lt;li&gt; &lt;%= review.content %&gt; &lt;/li&gt;
           &lt;li&gt; &lt;i&gt; &lt;%= review.name %&gt; &lt;/i&gt; &lt;/li&gt;
         &lt;/ul&gt;
       &lt;% end %&gt;  
    &lt;/div&gt; 
   &lt;/div&gt;
  </code></pre>
  
  <p>The thing that confuses me is that I have two other practically the same models, but they work well.</p>
  
  <p>Thanks! </p>