Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

20150113213922_remove_users_mail.rb 347B

12345678910111213
  1. class RemoveUsersMail < ActiveRecord::Migration[4.2]
  2. def self.up
  3. remove_column :users, :mail
  4. end
  5. def self.down
  6. add_column :users, :mail, :string, :limit => 60, :default => '', :null => false
  7. EmailAddress.where(:is_default => true).each do |a|
  8. User.where(:id => a.user_id).update_all(:mail => a.address)
  9. end
  10. end
  11. end