Search for digitals through variants
This commit is contained in:
@@ -2,11 +2,6 @@ module Spree
|
||||
class Admin::DigitalsController < Spree::Admin::ResourceController
|
||||
belongs_to "spree/product", find_by: :permalink
|
||||
|
||||
def load_resource
|
||||
@object = @product = Product.find_by_permalink(params[:product_id])
|
||||
end
|
||||
|
||||
|
||||
protected
|
||||
def location_after_save
|
||||
admin_product_digitals_url(@product)
|
||||
|
||||
4
app/models/spree/product_decorator.rb
Normal file
4
app/models/spree/product_decorator.rb
Normal file
@@ -0,0 +1,4 @@
|
||||
|
||||
Spree::Product.class_eval do
|
||||
has_many :digitals, :through => :variants_including_master
|
||||
end
|
||||
Reference in New Issue
Block a user