Just add gem 'paper_trail', '~> 3.0.0' in Gemfile
How to add paper_trail as dependency to Spree extension?
-
19-10-2022 - |
Question
I'm creating a new spree extension, with paper_trail gem dependency. So, i want track models changes (products and orders). Then, When try to start rails application, i get this error:
undefined local variable or method `has_paper_trail'
My rails app Gemfile:
gem 'spree_blameable', path: '/spree_blameable'
My order_decorator.rb it's very simple:
Spree::Order.class_eval do
has_paper_trail
end
My gemspec:
s.add_dependency 'spree_core', '~> 2.1.4'
s.add_dependency 'paper_trail', '~> 3.0.0'
What is it I'm missing?
Edit: Just add gem 'paper_trail', '~> 3.0.0' in Gemfile
Excuse my grammar, Greetings
Solution 2
OTHER TIPS
Try adding
require 'paper_trail'
to your config/application.rb
after it includes 'rails/all'.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow