Inventory written in rails