Sha256: 552c032557fcbbec72095b192101469156a19923cb8198ff999759bba9ae9f62
Contents?: true
Size: 502 Bytes
Versions: 10
Compression:
Stored size: 502 Bytes
Contents
# encoding: UTF-8 class AddDisplayTypeToAnswers < ActiveRecord::Migration def self.up add_column :answers, :display_type, :string Answer.all.each{|a| a.update_attributes(:display_type => "hidden_label") if a.hide_label == true} remove_column :answers, :hide_label end def self.down add_column :answers, :hide_label, :boolean Answer.all.each{|a| a.update_attributes(:hide_label => true) if a.display_type == "hidden_label"} remove_column :answers, :display_type end end
Version data entries
10 entries across 10 versions & 3 rubygems