Skip to content

Commit

Permalink
Rename AlchemySolidus::TouchAlchemyIngredients
Browse files Browse the repository at this point in the history
If our namespace should be Alchemy::Solidus, then let's rename this
file, too.
  • Loading branch information
mamhoff committed Nov 21, 2024
1 parent 71181d6 commit e8e8106
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Alchemy
module Solidus
module SpreeProductDecorator
def self.prepended(base)
base.include AlchemySolidus::TouchAlchemyIngredients
base.include Alchemy::Solidus::TouchAlchemyIngredients
base.has_many :alchemy_ingredients, class_name: "Alchemy::Ingredients::SpreeProduct", as: :related_object, dependent: :nullify
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Alchemy
module Solidus
module SpreeTaxonDecorator
def self.prepended(base)
base.include AlchemySolidus::TouchAlchemyIngredients
base.include Alchemy::Solidus::TouchAlchemyIngredients
base.has_many :alchemy_ingredients, class_name: "Alchemy::Ingredients::SpreeTaxon", as: :related_object, dependent: :nullify
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Alchemy
module Solidus
module SpreeVariantDecorator
def self.prepended(base)
base.include AlchemySolidus::TouchAlchemyIngredients
base.include Alchemy::Solidus::TouchAlchemyIngredients
base.has_many :alchemy_ingredients, class_name: "Alchemy::Ingredients::SpreeVariant", as: :related_object, dependent: :nullify
end

Expand Down
20 changes: 20 additions & 0 deletions app/models/alchemy/solidus/touch_alchemy_ingredients.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# frozen_string_literal: true

module Alchemy
module Solidus
module TouchAlchemyIngredients
extend ActiveSupport::Concern

included do
after_update :touch_alchemy_ingredients
after_touch :touch_alchemy_ingredients
end

private

def touch_alchemy_ingredients
alchemy_ingredients.each(&:touch)
end
end
end
end
18 changes: 0 additions & 18 deletions app/models/alchemy_solidus/touch_alchemy_ingredients.rb

This file was deleted.

0 comments on commit e8e8106

Please sign in to comment.