Created
September 4, 2014 19:49
-
-
Save pjmorse/1ec55af054a34ab1f2cc to your computer and use it in GitHub Desktop.
Possible repeats-finding method
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def repeats | |
if @repeats | |
@repeats | |
elsif practitioner.present? | |
practitioner.practitioner_activities.where( | |
survey_id: survey_id, | |
start_hour: start_hour, | |
start_minute: start_minute, | |
end_hour: end_hour, | |
end_minute: end_minute, | |
school_id: school_id, | |
setting_id: setting_id, | |
role_activity_id: role_activity_id | |
).reject { |r| r.id == self.id } | |
else | |
[] | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment