diff --git a/template.rb b/template.rb index d4c757439..26e2fa26e 100644 --- a/template.rb +++ b/template.rb @@ -66,10 +66,11 @@ generate 'solidus:auth:install' end + gem "flickwerk", "~> 0.3.5" gem 'responders' gem 'solidus_support', '>= 0.12.0' - gem 'view_component', '~> 3.0' gem 'tailwindcss-rails', '~> 3.0' + gem 'view_component', '~> 3.0' gem_group :test do # We need to add capybara along with a javascript driver to support the provided system specs. @@ -120,6 +121,8 @@ RUBY application <<~RUBY + include Flickwerk + if defined?(FactoryBotRails) initializer after: "factory_bot.set_factory_paths" do require 'spree/testing_support/factory_bot' diff --git a/templates/app/overrides/product_featured_similar_products.rb b/templates/app/patches/models/product_featured_similar_products_patch.rb similarity index 87% rename from templates/app/overrides/product_featured_similar_products.rb rename to templates/app/patches/models/product_featured_similar_products_patch.rb index b957e86ef..901d4ffda 100644 --- a/templates/app/overrides/product_featured_similar_products.rb +++ b/templates/app/patches/models/product_featured_similar_products_patch.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -module ProductFeaturedSimilarProducts +module ProductFeaturedSimilarProductsPatch def self.prepended(base) base.scope :featured, -> { where(featured: true) } end diff --git a/templates/app/overrides/taxon_custom_queries.rb b/templates/app/patches/models/taxon_custom_queries_patch.rb similarity index 88% rename from templates/app/overrides/taxon_custom_queries.rb rename to templates/app/patches/models/taxon_custom_queries_patch.rb index 6e6439c6a..e60ba5126 100644 --- a/templates/app/overrides/taxon_custom_queries.rb +++ b/templates/app/patches/models/taxon_custom_queries_patch.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -module TaxonCustomQueries +module TaxonCustomQueriesPatch def featured(limit = 3) all_products.featured.order('RANDOM()').limit(limit) end