migrate to Rails 4.0 (closes foodcoops#214)

Conflicts:
	Gemfile.lock
This commit is contained in:
wvengen 2014-02-20 15:04:53 +01:00
parent 12d1221bfc
commit 7841245795
97 changed files with 659 additions and 557 deletions

View file

@ -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