Method: JSONAPI::Consumer::Resource::SerializerConcern#add_links
- Defined in:
- lib/jsonapi/consumer/resource/serializer_concern.rb
#add_links(name, association, options) ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/jsonapi/consumer/resource/serializer_concern.rb', line 22 def add_links(name, association, ) @hash[:links][name] ||= [] @hash[:links][name] += (association || []).map do |obj| case obj.class when String, Integer obj else obj.to_param end end end |