
#all throws error when used on STI-submodels
Reported by Sindre Aarsaether | March 9th, 2009 @ 07:45 AM
class Location
include DataMapper::Resource
property :id, Serial
property :type, Discriminator
property :name, String
end
class City < Location
end
>> City.all
~ Don't know how to quote Set objects (#<Set: {City}>)
RuntimeError: Don't know how to quote Set objects (#<Set: {City}>)
from /usr/local/lib/ruby/gems/1.8/gems/data_objects-0.9.12/lib/data_objects/quoting.rb:66:in `quote_value'
from /usr/local/lib/ruby/gems/1.8/gems/data_objects-0.9.12/lib/data_objects/quoting.rb:35:in `escape_sql'
from /usr/local/lib/ruby/gems/1.8/gems/data_objects-0.9.12/lib/data_objects/quoting.rb:29:in `gsub!'
from /usr/local/lib/ruby/gems/1.8/gems/data_objects-0.9.12/lib/data_objects/quoting.rb:29:in `escape_sql'
from /usr/local/lib/ruby/gems/1.8/gems/dm-core-0.10.0/lib/dm-core/adapters/data_objects_adapter.rb:70:in `execute_reader'
from /usr/local/lib/ruby/gems/1.8/gems/dm-core-0.10.0/lib/dm-core/adapters/data_objects_adapter.rb:70:in `read_many'
from /usr/local/lib/ruby/gems/1.8/gems/dm-core-0.10.0/lib/dm-core/adapters/data_objects_adapter.rb:205:in `with_connection'
from /usr/local/lib/ruby/gems/1.8/gems/dm-core-0.10.0/lib/dm-core/adapters/data_objects_adapter.rb:63:in `read_many'
from /usr/local/lib/ruby/gems/1.8/gems/dm-core-0.10.0/lib/dm-core/repository.rb:143:in `read_many'
from /usr/local/lib/ruby/gems/1.8/gems/dm-core-0.10.0/lib/dm-core/collection.rb:919:in `initialize'
from /usr/local/lib/ruby/gems/1.8/gems/extlib-0.9.11/lib/extlib/lazy_array.rb:373:in `[]'
from /usr/local/lib/ruby/gems/1.8/gems/extlib-0.9.11/lib/extlib/lazy_array.rb:373:in `lazy_load'
from /usr/local/lib/ruby/gems/1.8/gems/extlib-0.9.11/lib/extlib/lazy_array.rb:461:in `to_s'
Has been like this for a long time, I've just worked around it by doing Location.all(:type => City) instead, and forgot to report it.
Comments and changes to this ticket
-
Dan Kubb (dkubb) March 9th, 2009 @ 11:36 PM
- State changed from unconfirmed to resolved
(from [4143d1ee11e72e5152f94ce7471c31d0d20c1bc5]) Pass an Array of descendants to the Query instead of a Set
[#814 state:resolved] http://github.com/datamapper/dm-...
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 »
People watching this ticket
Referenced by
-
814 #all throws error when used on STI-submodels [#814 state:resolved] http://github.com/datamapper/dm-...