summaryrefslogtreecommitdiff
path: root/db/migrate/20121228101454_update_tenant_id.rb
diff options
context:
space:
mode:
Diffstat (limited to 'db/migrate/20121228101454_update_tenant_id.rb')
-rw-r--r--db/migrate/20121228101454_update_tenant_id.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/db/migrate/20121228101454_update_tenant_id.rb b/db/migrate/20121228101454_update_tenant_id.rb
new file mode 100644
index 0000000..5c46b04
--- /dev/null
+++ b/db/migrate/20121228101454_update_tenant_id.rb
@@ -0,0 +1,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