Sha256: 29e622e563082453e090f979f7d06741ea0838ca498a0d237723a13f2252c507
Contents?: true
Size: 487 Bytes
Versions: 28
Compression:
Stored size: 487 Bytes
Contents
module ShopifyApp module SessionStorage extend ActiveSupport::Concern class_methods do def store(session) shop = self.find_or_initialize_by(shopify_domain: session.url) shop.shopify_token = session.token shop.save! shop.id end def retrieve(id) return unless id if shop = self.find_by(id: id) ShopifyAPI::Session.new(shop.shopify_domain, shop.shopify_token) end end end end end
Version data entries
28 entries across 28 versions & 1 rubygems