Skip to content

Commit

Permalink
Added some logic to the seed script to populate half of the times fro…
Browse files Browse the repository at this point in the history
…m Pawnee Diaper Bank Org with a on_hand_minimum_quantity and a on_hand_recommended_quantity for demo and testing purposes
  • Loading branch information
grantmca committed Jul 6, 2024
1 parent 846dd95 commit b284855
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions db/seeds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,12 @@ def random_record_for_org(org, klass)
end
end

# Set minimum and recomended inventory levels for items at the Pawnee Diaper Bank Organization
half_items_count = (pdx_org.items.count/2).to_i
min_value = 1500
recomended_value = 2000
pdx_org.items.limit(half_items_count).update_all(on_hand_minimum_quantity: min_value, on_hand_recommended_quantity: recomended_value)

# ----------------------------------------------------------------------------
# Request Units
# ----------------------------------------------------------------------------
Expand Down

0 comments on commit b284855

Please sign in to comment.