I updated shopify_app gem to the latest version(13.0.0) and while starting the server I got this error
undefined methodstorage=' for ShopifyApp::SessionRepository:Class (NoMethodError)
Did you mean? shop_storage= `
I have a initializer called shopify_session_repository.rb
if Rails.configuration.cache_classes
ShopifyApp::SessionRepository.storage = Shop
else
reloader = defined?(ActiveSupport::Reloader) ? ActiveSupport::Reloader : ActionDispatch::Reloader
reloader.to_prepare do
ShopifyApp::SessionRepository.storage = Shop
end
end
This is the one throwing the error.
I tried using ShopifyApp::SessionRepository.shop_storage = Shop
And got this error:
* ArgumentError Exception: shop storage must respond to :store and :retrieve
But, I have include ShopifyApp::SessionStorage in my Shop model
Could you please help me with this!
You should be able to get rid of your custom initializer in your app. Now you can just add
ShopifyApp.configure do |config|
config.shop_session_repository = 'Shop'
end
And also make sure to change include ShopifyApp::SessionStorage to include ShopifyApp::ShopSessionStorage in your Shop model.
There is a migration guide in the README for 13.0.0 https://github.com/Shopify/shopify_app#migrating-to-1300
Thank you so much, worked like a charm!
Most helpful comment
You should be able to get rid of your custom initializer in your app. Now you can just add
And also make sure to change
include ShopifyApp::SessionStorageto includeShopifyApp::ShopSessionStoragein your Shop model.There is a migration guide in the README for 13.0.0 https://github.com/Shopify/shopify_app#migrating-to-1300