From a6d6c880f909af56e345eff1bd33db4c4b76b63d Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Fri, 28 Dec 2012 12:08:03 +0100 Subject: Updates some needed attributes of old installations. closes #32 --- db/migrate/20121228101454_update_tenant_id.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 db/migrate/20121228101454_update_tenant_id.rb (limited to 'db/migrate/20121228101454_update_tenant_id.rb') 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 -- cgit v1.2.3