Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #1056 #1057

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions app/models/order_article.rb
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,9 @@ def update_article_and_price!(order_article_attributes, article_attributes, pric
self.article_price = article.article_prices.first and save # Assign new created article price to order article
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(article_id: article_id, created_at: order.ends)) and save
# Ugly workaround for faulty db structure:
# Set created_at timestamp to just before the latest article price, to make sure the current article price isn't changed
create_article_price!(price_attributes.merge(article_id: article_id, created_at: article.article_prices.last.created_at - 1.second)) and save
end

# Updates ordergroup values
Expand Down
Loading