Sha256: ec0ccb6ca53111c0eac5999533ee59d103f8defa2d2eca97ef9b37e8924c2691
Contents?: true
Size: 432 Bytes
Versions: 69
Compression:
Stored size: 432 Bytes
Contents
module DiscoApp class SessionStorage def self.store(session) shop = Shop.find_or_initialize_by(shopify_domain: session.url) shop.shopify_token = session.token shop.save! shop.id end def self.retrieve(id) return unless id shop = Shop.find(id) ShopifyAPI::Session.new(shop.shopify_domain, shop.shopify_token) rescue ActiveRecord::RecordNotFound nil end end end
Version data entries
69 entries across 69 versions & 1 rubygems