Skip to content

Instantly share code, notes, and snippets.

@norbajunior
Created June 13, 2016 23:53
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 norbajunior/31f16acbbef9f0819833768aebc2a2ee to your computer and use it in GitHub Desktop.
Save norbajunior/31f16acbbef9f0819833768aebc2a2ee to your computer and use it in GitHub Desktop.
MedicalCare
.select([
MedicalCare.arel_table[:created_at],
MedicalCare.arel_table[:triage_entrance_id],
Sigtap::Occupation.arel_table[:name],
Person.arel_table[:name].as('person_name'),
Person.arel_table[:mother].as('person_mother'),
Person.arel_table[:birthdate].as('person_birthdate'),
])
.joins(:occupation, patient: :person)
.between(start_date, end_date)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment