rabl icon indicating copy to clipboard operation
rabl copied to clipboard

How can you limit amount of child?

Open yukitoto opened this issue 8 years ago • 4 comments

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 avatar Jul 21 '16 05:07 yukitoto

@yukitoto could you explain?

krzysiek1507 avatar Jul 21 '16 08:07 krzysiek1507

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.

yukitoto avatar Jul 21 '16 08:07 yukitoto

@krzysiek1507 Where you need more explanation?

yukitoto avatar Jul 26 '16 13:07 yukitoto

@yukitoto

try this it worked for me. https://stackoverflow.com/questions/10871721/limit-amount-of-childs-in-rabl

ieglonew01f avatar Dec 01 '18 17:12 ieglonew01f