
one-to-many associations where the many side is an STI subclass don't work
Reported by Phil Darnowsky | October 8th, 2008 @ 11:05 PM
Run the attached script which involve Bars that are a subclass of BarBase and belong to a Foo, and you get this error:
/usr/lib/ruby/gems/1.8/gems/dm-core-0.9.6/lib/dm-core/query.rb:413:in `append_condition': Unknown property 'type' (ArgumentError)
from /usr/lib/ruby/gems/1.8/gems/dm-core-0.9.6/lib/dm-core/query.rb:197:in `initialize'
from /usr/lib/ruby/gems/1.8/gems/dm-core-0.9.6/lib/dm-core/query.rb:196:in `each'
from /usr/lib/ruby/gems/1.8/gems/dm-core-0.9.6/lib/dm-core/query.rb:196:in `initialize'
from /usr/lib/ruby/gems/1.8/gems/dm-core-0.9.6/lib/dm-core/scope.rb:42:in `new'
from /usr/lib/ruby/gems/1.8/gems/dm-core-0.9.6/lib/dm-core/scope.rb:42:in `merge_with_default_scope'
from /usr/lib/ruby/gems/1.8/gems/dm-core-0.9.6/lib/dm-core/model.rb:402:in `scoped_query'
from /usr/lib/ruby/gems/1.8/gems/dm-core-0.9.6/lib/dm-core/model.rb:252:in `all'
from /usr/lib/ruby/gems/1.8/gems/dm-core-0.9.6/lib/dm-core/associations/relationship.rb:90:in `send'
... 8 levels...
from /usr/lib/ruby/gems/1.8/gems/dm-core-0.9.6/lib/dm-core/associations/relationship.rb:80:in `get_children'
from /usr/lib/ruby/gems/1.8/gems/dm-core-0.9.6/lib/dm-core/associations/one_to_many.rb:251:in `children'
from /usr/lib/ruby/gems/1.8/gems/dm-core-0.9.6/lib/dm-core/associations/one_to_many.rb:309:in `method_missing'
from one_to_many_sti.rb:32
Comments and changes to this ticket
-
Phil Darnowsky October 9th, 2008 @ 09:28 AM
- Tag set to associations, belongs_to, bug, has_many, sti
Doing some more research this morning, it seems like this is known not to be implemented--I'd thought it was.
-
Phil Darnowsky October 13th, 2008 @ 10:22 AM
And, from still more research, it seems like this is intended not to be implemented--so this ticket is probably invalid.
-
Dan Kubb (dkubb) December 1st, 2008 @ 01:48 PM
- State changed from new to open
- Assigned user cleared.
Phil, even though I can confirm this doesn't work, it is a bug because the intention is for this to work.
-
Dan Kubb (dkubb) January 8th, 2009 @ 04:49 AM
- State changed from open to accepted
- Assigned user set to Dan Kubb (dkubb)
-
Jonathan Stott (namelessjon) February 22nd, 2009 @ 09:01 AM
- Tag changed from associations, belongs_to, bug, has_many, sti to associations, belongs_to, bug, has_many, one_file_test, sti
- State changed from accepted to resolved
Fixed in 0.10.0 (see updated script, attached)
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 »