#814 ✓resolved
Sindre Aarsaether

#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

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.

New-ticket Create new ticket

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

Tags

Referenced by

Pages