Extract links and type-related methods to their own module.

This commit is contained in:
Lucas Hosseini
2016-01-12 15:05:39 +01:00
parent 34e5faa1c4
commit f6fe0c8aa3
4 changed files with 63 additions and 31 deletions

View File

@@ -208,7 +208,7 @@ module ActiveModel
end
def links_for(serializer)
serializer.links.each_with_object({}) do |(name, value), hash|
serializer._links.each_with_object({}) do |(name, value), hash|
hash[name] =
if value.respond_to?(:call)
link = Link.new(serializer)