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

Replace outdated section url with attendance url in the workshop organizer report #16321

Merged
merged 2 commits into from Jul 10, 2017

Conversation

aoby
Copy link
Contributor

@aoby aoby commented Jul 10, 2017

No description provided.

CDO.code_org_url("/teacher-dashboard#/sections/#{workshop.section.id}", 'http:')
def attendance_url
return nil if workshop.sessions.empty?
"#{workshop_url}/attendance/#{workshop.sessions.first.id}"
Copy link
Contributor

Choose a reason for hiding this comment

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

You could write this as a ternary - workshop.sessions.any? ? "that_string" : nil

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I find if to be more readable this way, since I don't expect a workshop to have zero sessions, yet I'd like to handle that potential case instead of blowing up. Unless you strongly prefer the ternary I'd prefer to leave it.

@mehalshah
Copy link
Contributor

LGTM - one comment

@aoby aoby merged commit 34d2092 into staging Jul 10, 2017
@aoby aoby deleted the pd-report-session-attendance-link branch July 10, 2017 23:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants