Sha256: a30803c73d3c955ac026aa0e2774e2f07c4ca26b2150fdbed96115fb123f3c94

Contents?: true

Size: 609 Bytes

Versions: 8

Compression:

Stored size: 609 Bytes

Contents

class AddCalculateBalanceStrategyTypes
  
  def self.up
    [
        ['Calculate with invoices and payments', 'invoices_and_payments'],
        ['Calculate with payments', 'payments'],
        ['Calculate with invoices items and payments', 'invoice_items_and_payments']
    ].each do |item|
      CalculateBalanceStrategyType.create(:description => item[0], :internal_identifier => item[1])
    end

  end
  
  def self.down
    ['invoices_and_payments','payments', 'invoice_items_and_payments'].each do |iid|
      CalculateBalanceStrategyType.destroy_all("internal_identifier = #{iid}")
    end
  end

end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
erp_invoicing-4.2.0 db/data_migrations/20120605154637_add_calculate_balance_strategy_types.rb
erp_invoicing-4.1.0 db/data_migrations/20120605154637_add_calculate_balance_strategy_types.rb
erp_invoicing-4.0.0 db/data_migrations/20120605154637_add_calculate_balance_strategy_types.rb
erp_invoicing-3.1.0 db/data_migrations/20120605154637_add_calculate_balance_strategy_types.rb
erp_invoicing-3.0.6 db/data_migrations/20120605154637_add_calculate_balance_strategy_types.rb
erp_invoicing-3.0.5 db/data_migrations/20120605154637_add_calculate_balance_strategy_types.rb
erp_invoicing-3.0.4 db/data_migrations/20120605154637_add_calculate_balance_strategy_types.rb
erp_invoicing-3.0.3 db/data_migrations/20120605154637_add_calculate_balance_strategy_types.rb