Sha256: 70a0f5e8485b724c918ae309e333ac77b341abc2c600088363ffab7eaa8a2ec4
Contents?: true
Size: 381 Bytes
Versions: 21
Compression:
Stored size: 381 Bytes
Contents
class EnsureDefaultStore < ActiveRecord::Migration[4.2] class Store < ActiveRecord::Base self.table_name = 'spree_stores' end def up unless Store.where(default: true).exists? store = Store.first raise "Database has no stores. One should have been created in a previous migration." unless store store.update_column(:default, true) end end end
Version data entries
21 entries across 21 versions & 1 rubygems