Skip to content
This repository has been archived by the owner on Aug 13, 2021. It is now read-only.

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

Open
krtschmr opened this issue Jul 30, 2016 · 0 comments
Open

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

krtschmr opened this issue Jul 30, 2016 · 0 comments

Comments

@krtschmr
Copy link

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?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant