Skip to content

Commit

Permalink
Closes #34
Browse files Browse the repository at this point in the history
  • Loading branch information
lentschi committed Jan 12, 2024
1 parent 5a06392 commit 4561797
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
3 changes: 2 additions & 1 deletion db/migrate/20231104141204_create_article_units.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ def up

add_index :article_units, :unit, unique: true

# TODO: modify list and make it scan current article units to determine, if metric, imperial or both unit types should be added:
# TODO: modify list and make it scan current article units to determine, if metric, imperial or both unit types should be added
# (see see https://github.com/foodcoopsat/foodsoft_hackathon/issues/35):
unit_codes = %w[GRM HGM KGM LTR MLT PTN STC XPP XCR XBO XBH XGR XPK XSA XPU XPT]
unit_codes.each do |unit_code|
insert(%{
Expand Down
6 changes: 6 additions & 0 deletions db/seeds/hackathon.seeds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
FinancialTransactionClass.create!(:id => 1, :name => 'Standard')
FinancialTransactionClass.create!(:id => 2, :name => 'Foodsoft')

## Article units

# TODO: - make this depend on locale - see https://github.com/foodcoopsat/foodsoft_hackathon/issues/35
unit_codes = %w[GRM HGM KGM LTR MLT PTN STC XPP XCR XBO XBH XGR XPK XSA XPU XPT]
unit_codes.each { |unit_code| ArticleUnit.create!(unit: unit_code) }

## Suppliers & articles

SupplierCategory.create!(:id => 1, :name => "Other", :financial_transaction_class_id => 1)
Expand Down
6 changes: 6 additions & 0 deletions db/seeds/hackathon_de.seeds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
FinancialTransactionClass.create!(:id => 1, :name => 'Standard')
FinancialTransactionClass.create!(:id => 2, :name => 'Foodsoft')

## Article units

# TODO: - make this depend on locale - see https://github.com/foodcoopsat/foodsoft_hackathon/issues/35
unit_codes = %w[GRM HGM KGM LTR MLT PTN STC XPP XCR XBO XBH XGR XPK XSA XPU XPT]
unit_codes.each { |unit_code| ArticleUnit.create!(unit: unit_code) }

## Suppliers & articles

SupplierCategory.create!(:id => 1, :name => "Other", :financial_transaction_class_id => 1)
Expand Down

0 comments on commit 4561797

Please sign in to comment.