Evaluate association blocks as scopes on the association

This commit is contained in:
Benjamin Fleischer
2015-12-04 13:58:22 -06:00
parent 3e8290a923
commit 386a567dfc
2 changed files with 11 additions and 3 deletions

View File

@@ -128,8 +128,8 @@ module ActiveModel
class InlineAssociationTestPostSerializer < ActiveModel::Serializer
has_many :comments
has_many :last_comments do
object.comments.last(1)
has_many :comments, key: :last_comments do
last(1)
end
end