Rename and comment new functions for fixing stock ordering
This commit is contained in:
parent
8d0761a6c8
commit
6aa0e0b736
2 changed files with 6 additions and 3 deletions
|
|
@ -48,8 +48,9 @@ class Article < ActiveRecord::Base
|
|||
order_article ? order_article.order : nil
|
||||
end
|
||||
memoize :in_open_order
|
||||
|
||||
def ordered?(order)
|
||||
|
||||
# Returns true if the article has been ordered in the given order at least once
|
||||
def ordered_in_order?(order)
|
||||
order.order_articles.where(article_id: id).where('quantity > 0').one?
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue