Ensure that the article_id is set for every article_price
This addresses the TODO from dc92de771e.
This commit is contained in:
parent
26aecbbe9e
commit
3a6276aece
3 changed files with 22 additions and 8 deletions
|
|
@ -166,13 +166,7 @@ class OrderArticle < ApplicationRecord
|
|||
else
|
||||
# Creates a new article_price if neccessary
|
||||
# Set created_at timestamp to order ends, to make sure the current article price isn't changed
|
||||
create_article_price!(price_attributes.merge(created_at: order.ends)) and save
|
||||
# TODO: The price_attributes do not include an article_id so that
|
||||
# the entry in the database will not "know" which article is
|
||||
# referenced. Let us check the effect of that and change it or
|
||||
# comment on the meaning.
|
||||
# Possibly this is the real reason why the global price is not
|
||||
# affected instead of the `created_at: order.ends` injection.
|
||||
create_article_price!(price_attributes.merge(article_id: article_id, created_at: order.ends)) and save
|
||||
end
|
||||
|
||||
# Updates ordergroup values
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue