Sha256: f326b411c31760f04ba172dc19c54b42fc91fce354979a08e3c5cb2866dcf3ff

Contents?: true

Size: 674 Bytes

Versions: 12

Compression:

Stored size: 674 Bytes

Contents

# This migration comes from erp_orders (originally 20120229174343)
class AddOrdersWidget
  
  def self.up
    #insert data here
    if Widget.find_by_internal_identifier('order_management').nil?
      app = Application.find_by_internal_identifier('crm')

      orders = Widget.create(
        :description => 'Order Managament',
        :internal_identifier => 'order_management',
        :icon => 'icon-grid',
        :xtype => 'partyorderstab'
      )

      unless app.nil?
        app.widgets << orders
        app.save
      end
      
    end
  end
  
  def self.down
    #remove data here
    Widget.find_by_internal_identifier('order_management').destroy
  end

end

Version data entries

12 entries across 12 versions & 7 rubygems

Version Path
erp_orders-3.1.1 spec/dummy/db/data_migrations/20120229174343_add_orders_widget.erp_orders.rb
erp_txns_and_accts-3.1.1 spec/dummy/db/data_migrations/20120229174343_add_orders_widget.erp_orders.rb
erp_commerce-3.1.3 spec/dummy/db/data_migrations/20120229174343_add_orders_widget.erp_orders.rb
erp_products-3.1.1 spec/dummy/db/data_migrations/20120229174343_add_orders_widget.erp_orders.rb
erp_commerce-3.1.1 spec/dummy/db/data_migrations/20120229174343_add_orders_widget.erp_orders.rb
erp_invoicing-3.1.0 spec/dummy/db/data_migrations/20120229174343_add_orders_widget.erp_orders.rb
erp_financial_accounting-3.1.0 spec/dummy/db/data_migrations/20120229174343_add_orders_widget.erp_orders.rb
erp_inventory-3.1.0 spec/dummy/db/data_migrations/20120229174343_add_orders_widget.erp_orders.rb
erp_commerce-3.1.0 spec/dummy/db/data_migrations/20120229174343_add_orders_widget.erp_orders.rb
erp_txns_and_accts-3.1.0 spec/dummy/db/data_migrations/20120229174343_add_orders_widget.erp_orders.rb
erp_orders-3.1.0 spec/dummy/db/data_migrations/20120229174343_add_orders_widget.erp_orders.rb
erp_products-3.1.0 spec/dummy/db/data_migrations/20120229174343_add_orders_widget.erp_orders.rb