
SEL not working for 1:1 association?
Reported by Simon Rozet | July 10th, 2009 @ 07:29 AM
Running against:
- dm-core: ba3d0cacb7ae9fa3a5afee9f59a70d19877af1a3
- dm-more: fcb84b6280e6e30d1b640fca79bf2a3eb91ad6ac
- extlib: 1b4526d528a44aa8ea2809e291a6b926f8d56bc4
This gist ( https://gist.github.com/1112a342f677e64f3fe5 ) shows that SEL doesn't seem to be working (it performs 1+n queries)
Comments and changes to this ticket
-
Martin Gamsjaeger (snusnu) July 10th, 2009 @ 07:44 AM
- Assigned user set to Dan Kubb (dkubb)
- State changed from new to confirmed
I can confirm that this happens and additionally i see a weird nil access after the last entry in the collection was accessed. pastie with output excerpt can be found at http://pastie.org/541252
-
Dan Kubb (dkubb) July 10th, 2009 @ 12:00 PM
- State changed from confirmed to accepted
It appears there are two issues here. When I correct them SEL works, see example:
https://gist.github.com/d7154042664c042c0ff9
The issues are:
-
The build attribute conflicts with the deprecated build() method in OneToMany::Collection. DM doesn't add any accessor/mutator that conflicts with something defined in DM, but I think I need to add an exception for deprecated methods. As a test I used undef_method to remove the deprecated method in this gist.
-
When lazy loading attributes are used it doesn't seem to use SEL. Note in the gist how I added :lazy => false to the output property? That combined with undef'ing build(), I was able to get SEL to work.
Lazy loading not working with SEL is probably what will be fixed first since it affects the majority of people, and the other problem has a temp work-around. I'm not sure why it's not working yet because it was specifically supposed to work with SEL.. although most of that work was done before I added SEL back into dm-core and figured out a decent way to spec it all.
-
Dan Kubb (dkubb) July 10th, 2009 @ 12:03 PM
BTW just for fun I rewrote this example using some of the new syntax available in dm-core 0.10:
https://gist.github.com/47bfcd88cce4e8af6f52
Enjoy :)
-
Dan Kubb (dkubb) October 4th, 2009 @ 09:33 PM
- Milestone changed from 0.10.0 to 0.10.2
[project:id#20609 not-tagged:"0.10.0" milestone:id#51895 bulk edit command]
-
Dan Kubb (dkubb) February 1st, 2010 @ 04:33 PM
- Milestone changed from 0.10.2 to 1.0.0
-
-
-
Dan Kubb (dkubb) February 2nd, 2010 @ 02:47 AM
- State changed from accepted to confirmed
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »