Limit children for deletion notice#2491
Conversation
5a93245 to
d79d5f7
Compare
c263202 to
28d1770
Compare
28d1770 to
a37fcae
Compare
There was a problem hiding this comment.
The problem with this is that it still fetches all children from the database.
I implemented a quick and dirty fix for this here: https://github.com/alexandergitter/rails_admin/commit/6a172da72c98bfd5ca7285b356478a16e7a7a064
There was a problem hiding this comment.
I don't think that children are fetched from database here.
children variable contains a CollectionProxy returned to _delete_notice.html.haml where count and 'first(limit) is called. First n children are fetched here.
Am I wrong ?
There was a problem hiding this comment.
Mhh that's interesting, I didn't notice that.
In my tests Active Record did an unlimited SELECT though, not sure if there's something else that would trigger that... maybe it's because children gets wrapped in a new array? Would that eagerly fetch all children?
There was a problem hiding this comment.
Yes, wrapping children in a a new array may fetch database values.
|
Seems okay, thanks! |
Limit number of future orphans displayed during deletion confirmation in order to avoid performance issue.