title: inserting in model works in development but not in production
body: <p>I am stuck in really weird issue. i have the following code in my <code>SessionsController</code></p>
  
  <pre><code>def create
      user = User.find_by_email(params[:session][:email].downcase)
      if user &amp;&amp; user.authenticate(params[:session][:password])
        sign_in user
        @history=user.histories.build(:TimeLogin =&gt; Time.now.strftime("%d/%m/%Y %H:%M"))
        @history.save
        redirect_back_or "/recalls"
      else
        flash.now[:error] = 'Invalid email/password combination'
        render 'new'
      end
    end
  </code></pre>
  
  <p>i am trying to save login time in my <code>History</code> model. this works fine at development environment. but when i add my work to heroku i get the following error in logs</p>
  
  <pre><code>2013-10-29T06:47:29.542675+00:00 app[web.1]: ActiveRecord::StatementInvalid (PGError: ERROR:  null value in column "id" violates not-null constraint
  2013-10-29T06:47:29.542675+00:00 app[web.1]: DETAIL:  Failing row contains (null, 2013-10-29 06:47:00, null, 1, 2013-10-29 06:47:29.533033, 2013-10-29 06:47:29.533033).
  2013-10-29T06:47:29.542675+00:00 app[web.1]: : INSERT INTO "histories" ("TimeLogin", "TimeLogout", "created_at", "id", "updated_at", "user_id") VALUES ($1, $2, $3, $4, $5, $6)):
  2013-10-29T06:47:29.542675+00:00 app[web.1]:   app/controllers/sessions_controller.rb:11:in `create'
  </code></pre>
  
  <p>please guide me what i am doing wrong? i am unable to figure out because same works at my dev site
  Thanks in Advance</p>