NoMethodError - undefined method `timestamp_sort_order' for Paper trail issue after upgrading Rails 4.2

前端 未结 3 1757
我寻月下人不归
我寻月下人不归 2021-01-19 08:23

I used paper_trail to tracking transnational changes when I migrated rails 3.2 to rails 4.2, have got below issue:

NoMethodError - undefined method `t

3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-19 09:01

    In Rails 6, the preferred method is now to create a model, do not put model code in the initializer. This is what I'm using...

    module PaperTrail
      class Version < ::ActiveRecord::Base
        include PaperTrail::VersionConcern
    
        belongs_to :user, foreign_key: :whodunnit
      end
    end
    

提交回复
热议问题