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

Jl calendar day bug #686

Merged
merged 4 commits into from Sep 29, 2016
Merged

Jl calendar day bug #686

merged 4 commits into from Sep 29, 2016

Conversation

jleonardw9
Copy link
Contributor

No description provided.

@@ -216,7 +216,7 @@ def visits_select_options(arm, pages)
(beginning_visit..ending_visit).each do |visit_number|
visit_group = arm.visit_groups[visit_number - 1]

if visit_group.day.present?
unless visit_group.day.nil?
Copy link
Contributor

Choose a reason for hiding this comment

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

if visit_group.day would be equivalent, and a little more understandable, in my opinion.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I agree. I'd like to see this changed before merge.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm fine either way. I think I prefer it the way it is. Both ways make sense to me.

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 accidentally changed that when I was experimenting. I'll change it back.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Reverted back to original.

@@ -48,6 +48,14 @@ class Arm < ActiveRecord::Base
validates :visit_count, numericality: { greater_than: 0 }
validates :subject_count, numericality: { greater_than: 0 }

validate do |arm|
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a better way of doing this? This seems too hard-coded

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 agree, but I couldn't figure out another way to make the validations chain back down to the visit groups. Let's think on it and try to refactor down the road.

@jleonardw9 jleonardw9 merged commit 63be763 into master Sep 29, 2016
@jleonardw9 jleonardw9 deleted the jl-calendar-day-bug branch September 29, 2016 15:59
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.

None yet

5 participants