API v1 order_articles endpoints

This commit is contained in:
wvengen 2018-10-13 16:21:37 +02:00 committed by wvengen
parent 127ae83f04
commit ed9192c47f
14 changed files with 323 additions and 4 deletions

View file

@ -20,6 +20,14 @@ class OrderArticle < ApplicationRecord
before_create :init_from_balancing
after_destroy :update_ordergroup_prices
def self.ransackable_attributes(auth_object = nil)
%w(id order_id article_id quantity tolerance units_to_order)
end
def self.ransackable_associations(auth_object = nil)
%w(order article)
end
# This method returns either the ArticlePrice or the Article
# The first will be set, when the the order is finished
def price