migrate to Rails 4.0 (closes foodcoops#214)
Conflicts: Gemfile.lock
This commit is contained in:
parent
12d1221bfc
commit
7841245795
97 changed files with 659 additions and 557 deletions
|
|
@ -3,7 +3,7 @@ class StockArticle < Article
|
|||
|
||||
has_many :stock_changes
|
||||
|
||||
scope :available, -> { undeleted.where'quantity > 0' }
|
||||
scope :available, -> { undeleted.where('quantity > 0') }
|
||||
|
||||
before_destroy :check_quantity
|
||||
|
||||
|
|
@ -19,7 +19,7 @@ class StockArticle < Article
|
|||
|
||||
def quantity_ordered
|
||||
OrderArticle.where(article_id: id).
|
||||
joins(:order).where("orders.state = 'open' OR orders.state = 'finished'").sum(:units_to_order)
|
||||
joins(:order).where(orders: {state: ['open', 'finished']}).sum(:units_to_order)
|
||||
end
|
||||
|
||||
def quantity_history
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue