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

前端 未结 3 1707
我寻月下人不归
我寻月下人不归 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:05

    got this on rails 6.0.0beta3 because I patched papertrail and forgot to add PaperTrail::VersionConcern, e.g.:

    module PaperTrail
      class Version < ::ActiveRecord::Base
        include PaperTrail::VersionConcern
      end
    end
    

    PaperTrail::Rails::Engine.eager_load! did not fix it for me

    looking at the source code it's calling it directly on an ActiveRecord::Base model, it's defined on PaperTrail::VersionConcern.

提交回复
热议问题