Here's my suggestion to add to the user model decorator:
Spree.user_class.class_eval do
belongs_to :supplier, class_name: 'Spree::Supplier'
has_many :variants, through: :supplier
def admin?
has_spree_role?("admin")
end
def supplier?
supplier.present?
end
end
I tested it with adding a new supplier and it worked.
Here's my suggestion to add to the user model decorator:
I tested it with adding a new supplier and it worked.