Skip to content

Instantly share code, notes, and snippets.

@pjmorse
Created September 4, 2014 19:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pjmorse/1ec55af054a34ab1f2cc to your computer and use it in GitHub Desktop.
Save pjmorse/1ec55af054a34ab1f2cc to your computer and use it in GitHub Desktop.
Possible repeats-finding method
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