mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 15:23:06 +00:00
Evaluate association blocks as scopes on the association
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user