diff --git a/example/config/initializers/shopify_session_repository.rb b/example/config/initializers/shopify_session_repository.rb index c295129d3..7b9e0c5bf 100644 --- a/example/config/initializers/shopify_session_repository.rb +++ b/example/config/initializers/shopify_session_repository.rb @@ -1,7 +1,9 @@ if Rails.configuration.cache_classes ShopifyApp::SessionRepository.storage = Shop else - ActionDispatch::Reloader.to_prepare do + reloader = defined?(ActiveSupport::Reloader) ? ActiveSupport::Reloader : ActionDispatch::Reloader + + reloader.to_prepare do ShopifyApp::SessionRepository.storage = Shop end end diff --git a/lib/generators/shopify_app/shop_model/templates/shopify_session_repository.rb b/lib/generators/shopify_app/shop_model/templates/shopify_session_repository.rb index c295129d3..7b9e0c5bf 100644 --- a/lib/generators/shopify_app/shop_model/templates/shopify_session_repository.rb +++ b/lib/generators/shopify_app/shop_model/templates/shopify_session_repository.rb @@ -1,7 +1,9 @@ if Rails.configuration.cache_classes ShopifyApp::SessionRepository.storage = Shop else - ActionDispatch::Reloader.to_prepare do + reloader = defined?(ActiveSupport::Reloader) ? ActiveSupport::Reloader : ActionDispatch::Reloader + + reloader.to_prepare do ShopifyApp::SessionRepository.storage = Shop end end