Sha256: 5320a70898a9c812b2fe748aab91b3fcbdb1e4df2a27c085157bc7b29a4662df
Contents?: true
Size: 382 Bytes
Versions: 10
Compression:
Stored size: 382 Bytes
Contents
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
Version data entries
10 entries across 10 versions & 1 rubygems