I hereby claim:
- I am andrewreid on github.
- I am ndrewreid (https://keybase.io/ndrewreid) on keybase.
- I have a public key ASC0rWlvCxSzX6Z7Uq30N4bI2O16wUQdcS4n0cWGHbLg5Ao
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
# Original method: renders take up to 300ms, a stacktonne of N+1 queries | |
# GET /api/users_with_qualifications/ALS.json | |
def users_with_qualifications | |
last_modified = User.with_qualifications(params[:qualification]).select("MAX(users.updated_at) as max").first.max | |
render(:json => []) and return if last_modified.nil? | |
if stale?(:last_modified => Time.parse(last_modified), :etag => params[:qualification]) | |
# TODO: find a way to have with_highest_qualifaction(...) | |
qual = User::QUAL_LEVELS[params[:qualification]] | |
users = User.with_qualifications(params[:qualification]).select("id, first_name, last_name, qualifications_mask").order('last_name ASC').all.reject do |r| |
Table "public.events" | |
Column | Type | Modifiers | |
---------------------+-----------------------------+----------------------------------------------------- | |
id | integer | not null default nextval('events_id_seq'::regclass) | |
name | character varying(255) | | |
location | text | | |
notes | text | | |
created_at | timestamp without time zone | not null | |
updated_at | timestamp without time zone | not null | |
default_shift_start | timestamp without time zone | |