I added two attributes to my model:
#group.rb
class Spree::Group < ActiveRecord::Base
has_many :users
end
#user_decorator.rb
Spree::User.class_eval do
belongs_to :group, class_name: "Spree::Group"
end
I created a new spree folder in my models directory and created a file for group.rb and user_decorator.rb and added the code then ran:
bundle exec rake:db migrate
I then recived this error:
NameError: uninitialized constant Spree::User
I'm unsure of how to fix this error and wonder if it is because I just added the attributes to my model.
very informative blog and useful article thank you for sharing with us , keep posting Ruby on Rails Online Course Hyderabad
RépondreSupprimer