Add support for dynamic string-links in JsonApi adapter.

This commit is contained in:
Lucas Hosseini
2015-12-29 20:02:32 +01:00
parent 316026e9ce
commit 30d8414cce
4 changed files with 25 additions and 17 deletions

View File

@@ -13,6 +13,10 @@ module ActiveModel
end
link :other, '//example.com/resource'
link :yet_another do
"//example.com/resource/#{object.id}"
end
end
def setup
@@ -52,7 +56,8 @@ module ActiveModel
stuff: 'value'
}
},
other: '//example.com/resource'
other: '//example.com/resource',
yet_another: '//example.com/resource/1337'
}
assert_equal(expected, hash[:data][:links])
end