Sha256: 629b44721bdf0f527424577512f2f48f60c23a8920587c70821d87c05976475b

Contents?: true

Size: 526 Bytes

Versions: 2

Compression:

Stored size: 526 Bytes

Contents

class AddBillpayWidget
  
  def self.up
    #insert data here
    if Widget.find_by_internal_identifier('billpay').nil?
      app = Application.find_by_internal_identifier('crm')

      billpay = Widget.create(
        :description => 'Bill Pay',
        :internal_identifier => 'billpay',
        :icon => 'icon-grid',
        :xtype => 'billpay'
      )

      app.widgets << billpay
      app.save

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

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
erp_invoicing-3.1.0 db/data_migrations/20120229174322_add_billpay_widget.rb
erp_invoicing-3.0.6 db/data_migrations/20120229174322_add_billpay_widget.rb