spree-contrib / spree-multi-domain

Multiple Spree stores on different domains - single unified backed for processing orders
https://guides.spreecommerce.org
194 stars 191 forks source link

[Admin::Order) Search/Add variants will list ALL variants #153

Open krtschmr opened 8 years ago

krtschmr commented 8 years ago

isn't it better if i can search only the products/variants that belongs to the store which the order belongs to ? i patched that. i add data-store-id to the body, send that in the ajax-request and then scope it

Spree::Api::V1::VariantsController.class_eval do 
  def scope
    #...
    variants.where(store_id: params[:store_id]).accessible_by(current_ability, :read) 

anybody know a better solution?