Sha256: 82bac306093c6f8872c90c0f8b2a4580918389082b9ac679a83638d50960b96e

Contents?: true

Size: 631 Bytes

Versions: 40

Compression:

Stored size: 631 Bytes

Contents

# This migration comes from erp_app (originally 20120229160222)
class AddUserinfoWidget
  
  def self.up
    #insert data here
    if Widget.find_by_internal_identifier('userinfo').nil?
      app = Application.find_by_internal_identifier('crm')

      user = Widget.create(
        :description => 'User Info',
        :internal_identifier => 'userinfo',
        :icon => 'icon-user',
        :xtype => 'userinfo'
      )
     
      unless app.nil?
        app.widgets << user
        app.save
      end

    end
  end
  
  def self.down
    #remove data here
    Widget.find_by_internal_identifier('userinfo').destroy
  end

end

Version data entries

40 entries across 40 versions & 13 rubygems

Version Path
knitkit-2.1.14 spec/dummy/db/data_migrations/20120229160222_add_userinfo_widget.erp_app.rb
knitkit-2.1.13 spec/dummy/db/data_migrations/20120229160222_add_userinfo_widget.erp_app.rb
erp_forms-3.1.1 spec/dummy/db/data_migrations/20120229160222_add_userinfo_widget.erp_app.rb
erp_app-3.1.14 spec/dummy/db/data_migrations/20130422163144_add_userinfo_widget.erp_app.rb
knitkit-2.1.12 spec/dummy/db/data_migrations/20120229160222_add_userinfo_widget.erp_app.rb
erp_orders-3.1.1 spec/dummy/db/data_migrations/20120229160222_add_userinfo_widget.erp_app.rb
erp_app-3.1.12 spec/dummy/db/data_migrations/20130422163144_add_userinfo_widget.erp_app.rb
knitkit-2.1.9 spec/dummy/db/data_migrations/20120229160222_add_userinfo_widget.erp_app.rb
knitkit-2.1.8 spec/dummy/db/data_migrations/20120229160222_add_userinfo_widget.erp_app.rb
erp_forms-3.1.0 spec/dummy/db/data_migrations/20120229160222_add_userinfo_widget.erp_app.rb
erp_app-3.1.10 spec/dummy/db/data_migrations/20130422163144_add_userinfo_widget.erp_app.rb
erp_app-3.1.9 spec/dummy/db/data_migrations/20120229160222_add_userinfo_widget.erp_app.rb
erp_app-3.1.8 spec/dummy/db/data_migrations/20130422163144_add_userinfo_widget.erp_app.rb
knitkit-2.1.7 spec/dummy/db/data_migrations/20120229160222_add_userinfo_widget.erp_app.rb
erp_txns_and_accts-3.1.1 spec/dummy/db/data_migrations/20120229160222_add_userinfo_widget.erp_app.rb
erp_commerce-3.1.3 spec/dummy/db/data_migrations/20120229160222_add_userinfo_widget.erp_app.rb
knitkit-2.1.5 spec/dummy/db/data_migrations/20120229160222_add_userinfo_widget.erp_app.rb
erp_app-3.1.6 spec/dummy/db/data_migrations/20120229160222_add_userinfo_widget.erp_app.rb
erp_products-3.1.1 spec/dummy/db/data_migrations/20120229160222_add_userinfo_widget.erp_app.rb
erp_commerce-3.1.1 spec/dummy/db/data_migrations/20120229160222_add_userinfo_widget.erp_app.rb