-
Notifications
You must be signed in to change notification settings - Fork 342
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The most common way the nearby endpoint would be used is to display locations near the one currently being visited on a map. A client would only need a few location attributes to make use of this endpoint, such as the name, alternate name, latitude, longitude, address, and slug. By creating a special serializer that only returns a few attributes, we improve the performance of the nearby endpoint.
- Loading branch information
Moncef Belyamani
committed
Oct 22, 2014
1 parent
b5cb2fd
commit 90ba868
Showing
4 changed files
with
23 additions
and
9 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class NearbySerializer < ActiveModel::Serializer | ||
attributes :id, :alternate_name, :latitude, :longitude, :name, :slug | ||
|
||
has_one :address | ||
end |
This file contains 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