title: rails no such column error
body: <p>I have the following app. A Movie has many reviews, a moviegoer has many reviews.
  When I try to associate a review with a movie I get the following error</p>
  
  <pre><code>Review Load (0.1ms)  SELECT "reviews".* FROM "reviews" WHERE "reviews"."movie_id" = 5
  SQLite3::SQLException: no such column: reviews.movie_id: SELECT "reviews".* FROM     "reviews"  WHERE "reviews"."movie_id" = 5
  ActiveRecord::StatementInvalid: SQLite3::SQLException: no such column: reviews.movie_id:     SELECT "reviews".* FROM "reviews"  WHERE "reviews"."movie_id" = 5
  </code></pre>
  
  <p>after using a sql gui editor I found that the correct query should be</p>
  
  <pre><code>SELECT "reviews".* FROM "reviews" WHERE "movie_id" = 5
  </code></pre>
  
  <p>review.rb</p>
  
  <pre><code>class Review &lt; ActiveRecord::Base
    belongs_to :movie
    belongs_to :moviegoer
    attr_protected :moviegoer_id
  end
  </code></pre>
  
  <p>movie.rb and moviegoer.rb have </p>
  
  <blockquote>
    <p>has_many :reviews</p>
  </blockquote>
  
  <p>in them.
  schema.rb</p>
  
  <pre><code>ActiveRecord::Schema.define(:version =&gt; 20130222225620) do
  
  create_table "moviegoers", :force =&gt; true do |t|
  t.string   "name"
  t.string   "provider"
  t.string   "uid"
  t.datetime "created_at", :null =&gt; false
  t.datetime "updated_at", :null =&gt; false
  end
  
  create_table "movies", :force =&gt; true do |t|
  t.string   "title"
  t.string   "rating"
  t.text     "description"
  t.datetime "release_date"
  t.datetime "created_at",   :null =&gt; false
  t.datetime "updated_at",   :null =&gt; false
  end
  
  create_table "reviews", :force =&gt; true do |t|
  t.integer "potatoes"
  t.text    "comments"
  t.integer "moviegoers_id"
  t.integer "movies_id"
  end
  
  end
  </code></pre>
  
  <p>What am I doing wrong? why is rails querying "reviews"."movie_id" instead of just "movie_id"?</p>