Sha256: 5218b5fb51e4dbd9a81295dc1ea90043db9425a91f0637493d46b352f5b552ee

Contents?: true

Size: 1.52 KB

Versions: 13

Compression:

Stored size: 1.52 KB

Contents

class AddNewContactWidgets
  
  def self.up
    crm_app = OrganizerApplication.find_by_internal_identifier('crm')
    unless crm_app.nil?
      Widget.find_by_internal_identifier('party_contact_management').destroy

      phone_number_managementt_widget = ::Widget.create(
        :description => 'Phone Number Management',
        :icon => 'icon-grid',
        :xtype => 'phonenumbergrid',
        :internal_identifier => 'phone_number_management'
      )

      phone_number_managementt_widget.add_role('admin')
      phone_number_managementt_widget.add_role('employee')

      email_address_management_widget = ::Widget.create(
        :description => 'Email Address Management',
        :icon => 'icon-grid',
        :xtype => 'emailaddressgrid',
        :internal_identifier => 'email_address_management'
      )

      email_address_management_widget.add_role('admin')
      email_address_management_widget.add_role('employee')

      postal_address_management_widget = ::Widget.create(
        :description => 'Postal Address Management',
        :icon => 'icon-grid',
        :xtype => 'postaladdressgrid',
        :internal_identifier => 'postal_address_management'
      )

      postal_address_management_widget.add_role('admin')
      postal_address_management_widget.add_role('employee')

      crm_app.widgets << phone_number_managementt_widget
      crm_app.widgets << email_address_management_widget
      crm_app.widgets << postal_address_management_widget

      crm_app.save
    end
  end
  
  def self.down
    #remove data here
  end

end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
erp_app-3.0.13 db/data_migrations/20111108183740_add_new_contact_widgets.rb
erp_app-3.0.12 db/data_migrations/20111108183740_add_new_contact_widgets.rb
erp_app-3.0.10 db/data_migrations/20111108183740_add_new_contact_widgets.rb
erp_app-3.0.9 db/data_migrations/20111108183740_add_new_contact_widgets.rb
erp_app-3.0.8 db/data_migrations/20111108183740_add_new_contact_widgets.rb
erp_app-3.0.7 db/data_migrations/20111108183740_add_new_contact_widgets.rb
erp_app-3.0.6 db/data_migrations/20111108183740_add_new_contact_widgets.rb
erp_app-3.0.5 db/data_migrations/20111108183740_add_new_contact_widgets.rb
erp_app-3.0.4 db/data_migrations/20111108183740_add_new_contact_widgets.rb
erp_app-3.0.3 db/data_migrations/20111108183740_add_new_contact_widgets.rb
erp_app-3.0.2 db/data_migrations/20111108183740_add_new_contact_widgets.rb
erp_app-3.0.1 db/data_migrations/20111108183740_add_new_contact_widgets.rb
erp_app-3.0.0 db/data_migrations/20111108183740_add_new_contact_widgets.rb