Skip to content

Instantly share code, notes, and snippets.

@jamesgecko
Created May 31, 2011 21:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jamesgecko/1001310 to your computer and use it in GitHub Desktop.
Save jamesgecko/1001310 to your computer and use it in GitHub Desktop.
dm-sqlserver-adapter bug
>jruby test-dm.rb
Connecting with DataMapper
DataObjects::URI.new with arguments is deprecated, use a Hash of URI components
(C:/dev/jruby-1.6.2/lib/ruby/gems/1.8/gems/dm-do-adapter-1.1.0/lib/dm-do-adapter/adapter.rb:231:in `normalized_uri')
NoMethodError: undefined method `blank?' for "":String
select_statement at C:/dev/jruby-1.6.2/lib/ruby/gems/1.8/gems/dm-sqlserver-adapter-1.1.0/lib/dm-sqlserver-adapter/adapter.rb:48
read at C:/dev/jruby-1.6.2/lib/ruby/gems/1.8/gems/dm-do-adapter-1.1.0/lib/dm-do-adapter/adapter.rb:137
read at C:/dev/jruby-1.6.2/lib/ruby/gems/1.8/gems/dm-core-1.1.0/lib/dm-core/repository.rb:162
lazy_load at C:/dev/jruby-1.6.2/lib/ruby/gems/1.8/gems/dm-core-1.1.0/lib/dm-core/collection.rb:1117
each at C:/dev/jruby-1.6.2/lib/ruby/gems/1.8/gems/dm-core-1.1.0/lib/dm-core/support/lazy_array.rb:409
each at C:/dev/jruby-1.6.2/lib/ruby/gems/1.8/gems/dm-core-1.1.0/lib/dm-core/collection.rb:504
(root) at test-dm.rb:32
require 'rubygems'
require 'data_mapper'
puts "Connecting with DataMapper"
config = {
:adapter => 'sqlserver',
:database => 'db',
:username => 'user',
:password => 'pass',
:host => 'test',
:port => 1433
}
DataMapper::Logger.new($stdout, :debug)
DataMapper.setup(:default, config)
class Vehicles
include DataMapper::Resource
storage_names[:default] = 'Vehicles'
property :id, Serial, :field => 'Recnum'
property :policy_id, Integer, :field => 'PolRecNum'
property :number, Integer, :field => 'VehNumber'
property :make, String, :field => 'Make'
property :age, String, :field => 'Age'
end
DataMapper.finalize
vehicles = Vehicles.all
vehicles.each do |v|
puts v.make
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment