Sha256: 723b32e476bd328fb28139e61b2c9c3668a1e3c41c7d03db59ff7c8c1ee26668
Contents?: true
Size: 362 Bytes
Versions: 120
Compression:
Stored size: 362 Bytes
Contents
class AddKindToZone < ActiveRecord::Migration[4.2] 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
120 entries across 120 versions & 1 rubygems