Refresh cache when option type changed

This commit is contained in:
Rohan Mitchell
2016-02-26 09:59:16 +11:00
parent b5204a4820
commit 8928e461d4
2 changed files with 33 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
module Spree
OptionType.class_eval do
has_many :products, through: :product_option_types
after_save :refresh_products_cache
private
def refresh_products_cache
products(:reload).each &:refresh_products_cache
end
end
end