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

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

    I fixed this by adding below line in intializer paper_trail.rb file

    PaperTrail::Rails::Engine.eager_load!
    

    See my final intializers/paper_trail.rb file

    PaperTrail.config.track_associations = false
    
    PaperTrail::Rails::Engine.eager_load!
    
    module PaperTrail
    
      class Version < ActiveRecord::Base
        .....
      end
    
    end
    

    Problem resolved....

    Have updated my answer added below line extra using it with rails 5.2

    PaperTrail.config.track_associations = false
    

提交回复
热议问题