Following the steps to capture information from the controller as meta data does not work. (Ruby 2.3.3, Rails 4.2 and paper_trail 5.2.3)
has_paper_trail only: [:status]
class AddHotelToVersions < ActiveRecord::Migration
def change
add_reference :versions, :hotel, index: true, foreign_key: true, null: false
add_column :versions, :ip, :string, null: false
add_column :versions, :user_agent, :string, null: false
end
end
def info_for_paper_trail
{ hotel_id: current_user.hotel.id, ip: request.remote_ip, user_agent: request.user_agent }
end
I solved it upgrading paper trails to 6.0.2