Sha256: 71c17801ec46647fced1b242d6c2deacce6b4982d64e20b036f551936a0c891b
Contents?: true
Size: 584 Bytes
Versions: 23
Compression:
Stored size: 584 Bytes
Contents
class AddUniqueIdentifierToDiscernerOperators < ActiveRecord::Migration class Operator < ActiveRecord::Base include Discerner::Methods::Models::Operator end def change add_column :discerner_operators, :unique_identifier, :string Discerner::Operator.order(:id).each do |p| p.unique_identifier = p.text.parameterize.underscore p.save! end remove_index :discerner_operators, :name => 'index_discerner_operators' add_index :discerner_operators, [:unique_identifier, :deleted_at], :unique => true, :name => 'index_discerner_operators' end end
Version data entries
23 entries across 23 versions & 1 rubygems