spree-contrib / spree_drop_ship

Spree Drop Shipping Extension
BSD 3-Clause "New" or "Revised" License
104 stars 120 forks source link

2 4 beta #59

Closed brandon-a-hay closed 9 years ago

brandon-a-hay commented 9 years ago

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.

JDutil commented 9 years ago

Changes look okay but would be good to get remaining specs passing.

JDutil commented 9 years ago

Closing in favor of https://github.com/spree-contrib/spree_drop_ship/pull/66