Sha256: 0335ed81e7c529088c78d229153c47398b5842ac4f7b30bd05716c1818b99441

Contents?: true

Size: 607 Bytes

Versions: 3

Compression:

Stored size: 607 Bytes

Contents

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

3 entries across 3 versions & 1 rubygems

Version Path
erp_orders-3.1.1 db/data_migrations/20120229174343_add_orders_widget.rb
erp_orders-3.1.0 db/data_migrations/20120229174343_add_orders_widget.rb
erp_orders-3.0.6 db/data_migrations/20120229174343_add_orders_widget.rb