I've implemented paranoia on a model ("Stays"), which is working in development, but not in production on heroku. On the heroku site, I can see an (expectedly empty) index page, but when I go to /stays/new, I get an error page.
Checking the logs, I find this:
2017-01-18T03:31:49.546164+00:00 app[web.1]: [d5ce2502-2cb9-4b1d-9888-f2990881bbb4] Completed 500 Internal Server Error in 16ms (ActiveRecord: 4.3ms)
2017-01-18T03:31:49.547115+00:00 app[web.1]: [d5ce2502-2cb9-4b1d-9888-f2990881bbb4] ActiveModel::UnknownAttributeError (unknown attribute 'deleted_at' for Stay.):
2017-01-18T03:31:49.547194+00:00 app[web.1]: [d5ce2502-2cb9-4b1d-9888-f2990881bbb4] app/controllers/stays_controller.rb:14:in `new'
In app/controllers/stays_controller.rb, here are the first 15 lines.
class StaysController < ApplicationController
before_action :set_stay, only: [:show, :edit, :update, :destroy]
before_action :correct_user, only: [:edit, :update, :destroy]
before_action :authenticate_user!, except: [:index, :show]
def index
@stays = Stay.all.order("created_at DESC")
end
def show
end
def new
@stay = current_user.stays.build #Stay.new
end
In the gemfile:
gem 'paranoia', '~> 2.2'
In app/models/stay.rb:
class Stay < ApplicationRecord
belongs_to :user
acts_as_paranoid
end
I've run heroku run rake db:migrate
since pushing to heroku, but with no luck. Any idea why this is working locally for development, but not on heroku for production?