Created
May 11, 2011 19:08
-
-
Save diegoeche/967087 to your computer and use it in GitHub Desktop.
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 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