Skip to content

Commit

Permalink
Merge pull request #1150 from beauby/fix-jsonapi-add-relationships
Browse files Browse the repository at this point in the history
Remove legacy method accidentally reintroduced in #1017
  • Loading branch information
NullVoxPopuli committed Sep 14, 2015
2 parents 1ac82a1 + fb7ec88 commit d7534a6
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions lib/active_model/serializer/adapter/json_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def serializable_hash(options = nil)

def fragment_cache(cached_hash, non_cached_hash)
root = false if @options.include?(:include)
ActiveModel::Serializer::Adapter::JsonApi::FragmentCache.new().fragment_cache(root, cached_hash, non_cached_hash)
ActiveModel::Serializer::Adapter::JsonApi::FragmentCache.new.fragment_cache(root, cached_hash, non_cached_hash)
end

private
Expand All @@ -56,12 +56,6 @@ def resource_identifier_type_for(serializer)
end
end

def add_relationships(resource, name, serializers)
resource[:relationships] ||= {}
resource[:relationships][name] ||= { data: [] }
resource[:relationships][name][:data] += serializers.map { |serializer| { type: serializer.json_api_type, id: serializer.id.to_s } }
end

def resource_identifier_id_for(serializer)
if serializer.respond_to?(:id)
serializer.id
Expand Down

0 comments on commit d7534a6

Please sign in to comment.