title: NoMethodError (undefined method `password_digest=' for #<User>
body: <p>In controller:</p>
  
  <pre><code>def createUserForHotel
    @user=User.new(params_createUserForHotel)
    if @user.save
      flash[:notice]="New user is created for the hotel"
      redirect_to(:controller=&gt;'hotels',:action=&gt;"createnewhotel")
    else
      flash[:notice]="New user not created "
      redirect_to(:controller=&gt;'hotels',:action=&gt;"createnewhotel")
    end
  end
  
  def params_createUserForHotel
    params.require(:user).permit(:username,:password,:email,:hotel_id)
  end
  </code></pre>
  
  <p>In migration:</p>
  
  <pre><code>def up
    create_table :users do |t|
      t.string "first_name",:limit=&gt;25
      t.string "last_name",:limit=&gt;50
      t.string "email",:null=&gt;false,:limit=&gt;100
      t.string "username",:limit=&gt;50  
      t.string "password",:limit=&gt;40 
      t.integer "hotel_id"
      t.timestamps
    end
  
    add_index("users","hotel_id")
  end
  
  class AlterUsers &lt; ActiveRecord::Migration
    def up          
      rename_column("users","password","hashed_password")   
    end
  </code></pre>
  
  <p>In Heroku logs:</p>
  
  <pre><code>←[0m Started POST "/hotels/createUserForHotel" for 122.50.216.93 at 2014-11-16 10:18:16 +0000
  ←[36m2014-11-16T10:18:16.170638+00:00 app[web.1]:←[0m
  ←[36m2014-11-16T10:18:16.170641+00:00 app[web.1]:←[0m NoMethodError (undefined method password_digest=' for #&lt;User:0x007f036c8ffe50&gt;):
  ←[36m2014-11-16T10:18:16.170643+00:00 app[web.1]:←[0m   app/controllers/hotels_controller.rb:140:in createUserForHotel'
  ←[36m2014-11-16T10:18:16.170644+00:00 app[web.1]:←[0m
  </code></pre>
  
  <p>My application is working perfectly in development environment, but i am getting the above error in Heroku logs.I have deployed my application in Heroku.</p>