summaryrefslogtreecommitdiff
path: root/db/migrate/20121228101454_update_tenant_id.rb
blob: 5c46b040b632a6bdc54f7ef4cc45a7a892e05626 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
class UpdateTenantId < ActiveRecord::Migration
  def up
    Phone.where(:hot_deskable => true).each do |phone|
      phone.tenant_id = Tenant.last.id
      phone.fallback_sip_account = phone.sip_accounts.where(:sip_accountable_type => 'Tenant').first
      phone.save
    end
  end

  def down
  end
end