ruby on rails - Override ShopifyApp Module Method
I'm trying to override ShopifyApp's new method (https://github.com/Shopify/shopify_app/blob/master/lib/shopify_app/sessions_concern.rb) but not sure where to start. Basically I need to add another field to get a
module ShopifyApp module SessionsConcern module New def new if params[:field] == "abc" authenticate if params[:shop].present? end # or else ... end end end end
To use that module, I would do something like this in a controller:
But there's no where to use that. How to go about this the correct way?
Overriding is overriding. The following would do it for you without any
prepending (having that you are loading the code from
# lib/shopify_monkeypatching.rb module ShopifyApp module SessionsConcern def new if params[:field] == "abc" authenticate if params[:shop].present? end # or else ... end end end
Didn't find the answer?
Our community is visited by hundreds of Shopify development professionals every day. Ask your question and get a quick answer for free.
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.