Created
February 5, 2013 01:37
-
-
Save statonjr/4711393 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
| require 'roar/representer/json' | |
| require 'roar/representer/json/hal' | |
| require 'roar/representer/feature/hypermedia' | |
| require 'lib/api/representers/dealership_representer' | |
| module DealershipsRepresenter | |
| include Roar::Representer::JSON | |
| include Roar::Representer::JSON::HAL | |
| include Roar::Representer::Feature::Hypermedia | |
| link :self do | |
| ".../ds" | |
| end | |
| collection :dealerships, :rel => ".../rels/dealerships", :class => Motor::Dealership, :extend => DealershipRepresenter, :embedded => true | |
| end |
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 from | |
| (options[:from] || options[:as] || options[:rel] || name ).to_s | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment