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

Prevent non mc from dutying more than 6 hours consecutively #481

Open
wants to merge 55 commits into
base: master
Choose a base branch
from

Conversation

JQChong
Copy link
Contributor

@JQChong JQChong commented Apr 4, 2020

Created function `non_mc_exceed_hrs?' to check if non mc user duty for more than 6 hours after grabbing duty and implemented three test cases to check correctness

Ryo's edit: Resolves #300

env
Comment on lines +1 to +3
MAILGUN_API_KEY=key-0123456789abcdef0123456789abcdef
MAILGUN_DOMAIN=sandbox0123456789abcdef0123456789abcdef.mailgun.org
MAILER_HOST=nussucommit.org
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't include this file in the branch. (Btw, the filename is supposed to be .env, you're missing a dot)

all_time_ranges.sort! { |r1, r2| r1.start_time <=> r2.start_time }
end

def non_mc_exceed_hrs?(num_hrs, duty_ids)
Copy link

Choose a reason for hiding this comment

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

Metrics/AbcSize: Assignment Branch Condition size for non_mc_exceed_hrs? is too high. [26.42/18]

@@ -1,6 +1,7 @@
<div id="duty-start-time" data-start-time=<%= TimeRange.order(:start_time).first.start_time.strftime('%H') %>></div>
<div id="duty-end-time" data-end-time=<%= TimeRange.order(:end_time).last.end_time.strftime('%H')%>></div>
<div id="num-of-places" data-num-of-places=<%= @places.count %>></div>
<div id="current-user" data-current-user=<%= current_user%>>
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need this?

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.

Prevent non-mc from dutying more than 6 hours consecutively
4 participants