Sha256: 83657acc2c9a7c4c148edc82521e4914bb765763cba5513f52b4fcb7b80f3b64
Contents?: true
Size: 357 Bytes
Versions: 37
Compression:
Stored size: 357 Bytes
Contents
class AddKindToZone < ActiveRecord::Migration def change add_column :spree_zones, :kind, :string add_index :spree_zones, :kind Spree::Zone.find_each do |zone| last_type = zone.members.where.not(zoneable_type: nil).pluck(:zoneable_type).last zone.update_column :kind, last_type.demodulize.underscore if last_type end end end
Version data entries
37 entries across 37 versions & 2 rubygems