katharinechen/sims — pull request #5 by jaspeers (2014-11-26 22:33:36+00:00)
Title: Create inventory

Summary of changes / additions:
- modified rspec settings to force use of the expect syntax
- using FactoryGirl to create objects
- refactored / simplified Item model, only has a name attribute for now but may include more in future
- created Inventory model, which now holds stock and par levels for each item
- query stock levels with Inventory#understocked? and Inventory#to_order

Things I learned:
- Rubocop frowns on using validates_length_of / validates_presence_of etc, says to use validates (this is what you were already doing, just news to me)

Things I'm thinking about:
- Purchases table with item_id, price, quantity columns: since Items don't have a fixed price, but the Item object *might* end up having a default price.
- Locations table, each Inventory model can have a belongs_to relationship with a Location

I might work some more on this today/tomorrow.