This project is archived and is in readonly mode.
Relation fails to act like an Array on intersection
Reported by Kane | September 4th, 2010 @ 05:12 PM
ActivceRecord::Relations tries hard to act like an Array, but it fails when it comes to intersection (#&).
Test appended.
Comments and changes to this ticket
-
Marcelo Giorgi September 9th, 2010 @ 02:15 AM
- Assigned user set to Santiago Pastorino
- Tag set to patch
Hi,
I've just create a couple of patches to make this work.
First, I tried to apply Kane's test but I couldn't (on master). So, I've just copied the idea of the test (only used with a different model so that we don't need to load books fixture in this file) and added a first patch with Kane as author.
Then, my second patch is the working code that makes the test to pass.
-
Kane September 9th, 2010 @ 03:19 PM
nice!
this is exacly what i had in mind.
No problems while appling it to current master.
I think the test is straight forward, so is the implementation. +1 from me -
Nathan Kleyn September 9th, 2010 @ 05:10 PM
- Tag changed from patch to active record, activerecord relation, patch
This applied fine for me, and seems to be exactly what's needed. +1 from me too.
-
max.pettersen September 9th, 2010 @ 07:15 PM
The implementation seems to be correct for me, and also the test passes properly. +1
-
Marcelo Giorgi September 9th, 2010 @ 10:27 PM
- Tag changed from active record, activerecord relation, patch to active record, activerecord relation, patch, verified
Adding the verified tag now that 3 people have voted positively.
-
Rizwan Reza September 10th, 2010 @ 03:01 AM
- Importance changed from to Low
Hey Marcelo,
Can you send a pull request on Github to rails/rails for this one?
Thanks!
-
Mikel Lindsaar September 10th, 2010 @ 12:16 PM
- Assigned user changed from Santiago Pastorino to Mikel Lindsaar
OK, I am testing this now.
-
Mikel Lindsaar September 10th, 2010 @ 12:44 PM
- State changed from new to committed
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>