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

Fix time promotions bug #396

Merged
merged 2 commits into from
Sep 18, 2024
Merged

Fix time promotions bug #396

merged 2 commits into from
Sep 18, 2024

Conversation

marlena-b
Copy link
Collaborator

Issue: #386

include? cannot be used with time ranges so i used cover?.

Copy link

netlify bot commented Sep 6, 2024

Deploy Preview for ecommerce-events failed.

Name Link
🔨 Latest commit 85466a6
🔍 Latest deploy log https://app.netlify.com/sites/ecommerce-events/deploys/66ea77e9596a120008c74d19

@@ -45,9 +45,8 @@ def initialize(start_time, end_time, discount)
end

def running?(timestamp)
(@start_time...@end_time).include?(timestamp)
(@start_time...@end_time).cover?(timestamp)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fix looks perfect.

Apparently, the previous tests didn't catch this problem. Let's add tests as part of this change/fix.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added, thank you! 👍

@marlena-b marlena-b merged commit 1b9b763 into master Sep 18, 2024
27 of 31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants