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

Was it helpful?

Solution 2

Just add gem 'paper_trail', '~> 3.0.0' in Gemfile

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
scroll top