summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorStefan Wintermeyer <stefan.wintermeyer@amooma.de>2012-12-28 12:57:24 +0100
committerStefan Wintermeyer <stefan.wintermeyer@amooma.de>2012-12-28 12:57:24 +0100
commit9190c997fe17ed1c680d2b073c8d2e21ac864b57 (patch)
treeb932aef102aa0216f6a4dc69cb8765d1b59e3119 /db
parenta6d6c880f909af56e345eff1bd33db4c4b76b63d (diff)
Update some Phone attributes. Which where introduced with
9101b20cc5ca4e0553cfb4a503f0d2d51863ba37
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20121228101454_update_tenant_id.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/db/migrate/20121228101454_update_tenant_id.rb b/db/migrate/20121228101454_update_tenant_id.rb
index 5c46b04..dc2f37c 100644
--- a/db/migrate/20121228101454_update_tenant_id.rb
+++ b/db/migrate/20121228101454_update_tenant_id.rb
@@ -1,7 +1,11 @@
class UpdateTenantId < ActiveRecord::Migration
def up
- Phone.where(:hot_deskable => true).each do |phone|
+ Phone.all.each do |phone|
phone.tenant_id = Tenant.last.id
+ phone.save
+ end
+
+ Phone.where(:hot_deskable => true).each do |phone|
phone.fallback_sip_account = phone.sip_accounts.where(:sip_accountable_type => 'Tenant').first
phone.save
end