Skip to content

Instantly share code, notes, and snippets.

@diegoeche
Created May 11, 2011 19:08
Show Gist options
  • Save diegoeche/967087 to your computer and use it in GitHub Desktop.
Save diegoeche/967087 to your computer and use it in GitHub Desktop.
def as_json(options={})
# TODO: users.count and rating_sum are generating way too may queries,
# we should do something about them.
{
:latitude => latitude,
:longitude => longitude,
:title => title,
:id => id,
:users => users.count,
:cap => distance_cap,
:permanent => permanent,
:rating_sum => rating_sum,
}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment