Open sfeu opened 12 years ago
Hey,
have started to work on this issue. A first implementation and an improved spec can be found in this branch.
Its already working in most situations, but there is a problem which i think is related to the dm-core that prevents correct results if one queries for Person.all (see second test on spec above).
https://github.com/sfeu/dm-redis-adapter/tree/inheritance_fixes
Hello!
Catching up on issues this weekend. I'll have a look at your branch.
Hey,
would be great if you could take a look at it. Not sure if i did it correctly - but at least the specs continue to work ;-)
I asked for help regarding the remaining issue, but did not get an answer so far...
http://groups.google.com/group/datamapper/browse_thread/thread/3365c68cb0a3d170
Hey sfeu,
I had a look at this and I wasn't able to get much further than you were. At this point it looks as though it's doing a find with no conditions, and there isn't a simple way to express that all subclasses of the base type should be included. I'll keep working on it after I finish and merge the refactoring branch.
I'll keep an eye on the mailing list as well.
Thanks!
whoahbot
Hey whoahbot,
i was able to fix this problem by collecting all descendants myself for this special case. It works but unfortunately i have broken one of your tests ( "should allow has n :through"), because for the inheritance i need unique serials over all models:
i am not sure how to proceed...
When i played around with it and tried to change the broken test to run with the in_memory adapter instead of the redis one it fails there as well...
Hey,
i played around with the redis adapter, because i am thinking about changing from a tuplespace (rinda) to redis. But i have trouble with inheritance for queries - like described here: http://datamapper.org/docs/misc.html
So far as i understood the adapter code - I think that the redis adapter does not consider the InclusionComparison correctly in the perform_query function.
Can anyone help me to fix this for the redis adapter?
Attached the spec that shows the problem - it actually only returns Woman (First test) and Mother (second test) but not all of them, which i espected to happed for the first test.