Re: [Rails-core] CollectionAssociation shadows Enumerable#count

2017-05-15 Thread Omar Bohsali
Also agree with Matt Wean and Miles on this one. On Monday, May 15, 2017 at 3:33:26 PM UTC-7, Miles Georgi wrote: > > Agreed :+1: > > > > > > On Monday, May 15, 2017 at 1

Re: [Rails-core] CollectionAssociation shadows Enumerable#count

2017-05-15 Thread Miles Georgi
Agreed :+1: On Monday, May 15, 2017 at 10:18:07 PM UTC, Matt Wean wrote: > > I just ran into this issue, and I would actually call it a bug since it > causes very unex

Re: [Rails-core] CollectionAssociation shadows Enumerable#count

2017-05-15 Thread Matt Wean
I just ran into this issue, and I would actually call it a bug since it causes very unexpected behavior: > User.count { |user| user.not_a_method! } => 10 So the block isn't even being evaluated. I'm fine if we don't delegate to Enumerable, but I would expect #count to at least raise an error