rabl
rabl copied to clipboard
How can you limit amount of child?
I want to limit child amount.
object false
child @chat_groups, root: :chat_groups, object_root: false do
child :messages, root: :messages, object_root: false do
attributes :id
end
end
@yukitoto could you explain?
ChatGroup has many Messages. I want to limit messages limit to 40. if use above snippet, all messages will send. But I don't know how to limit messages.
@krzysiek1507 Where you need more explanation?
@yukitoto
try this it worked for me. https://stackoverflow.com/questions/10871721/limit-amount-of-childs-in-rabl