module Spree::UserDecorator
  def self.prepended(base)
    base.has_many :vendor_users, class_name: 'Spree::VendorUser'
    base.has_many :vendors, through: :vendor_users, class_name: 'Spree::Vendor'
  end
end

Spree::User.prepend Spree::UserDecorator

module Spree::UserDecorator
  def self.prepended(base)
    base.has_many :vendor_users, class_name: 'Spree::VendorUser'
    base.has_many :vendors, through: :vendor_users, class_name: 'Spree::Vendor'
  end
end

Spree.user_class.prepend Spree::UserDecorator

Use Spree.user_class rather than hardcoded Spree::User to allow usage without Spree Auth Devise
Use Spree.user_class rather than hardcoded Spree::User to allow usage without Spree Auth Devise
