Class: Spree::Seeds::ApiKeys

Inherits:
Object
  • Object
show all
Includes:
Spree::ServiceModule::Base
Defined in:
app/services/spree/seeds/api_keys.rb

Instance Method Summary collapse

Methods included from Spree::ServiceModule::Base

prepended

Instance Method Details

#callObject



6
7
8
9
10
11
12
13
# File 'app/services/spree/seeds/api_keys.rb', line 6

def call
  store = Spree::Store.default
  return unless store&.persisted?

  unless store.api_keys.active.publishable.exists?
    store.api_keys.create!(name: 'Default', key_type: 'publishable')
  end
end