Sha256: d1ebf8a03b97b76eb7eb9ea426218e82b801938f204f2bcf0445ad0c53712516
Contents?: true
Size: 376 Bytes
Versions: 9
Compression:
Stored size: 376 Bytes
Contents
class EnsureDefaultStore < ActiveRecord::Migration 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
9 entries across 9 versions & 1 rubygems