Refactor orders index

This commit is contained in:
wvengen 2015-02-18 23:46:50 +01:00
parent 27fe8a4d42
commit 1b48882c0e
3 changed files with 3 additions and 1 deletions

View file

@ -19,6 +19,7 @@ class Supplier < ActiveRecord::Base
validate :uniqueness_of_name
scope :undeleted, -> { where(deleted_at: nil) }
scope :having_articles, -> { where(id: Article.undeleted.select(:supplier_id).distinct) }
# sync all articles with the external database
# returns an array with articles(and prices), which should be updated (to use in a form)