#1513 new
aferns

Datamapper 1.1.0

Reported by aferns | June 2nd, 2011 @ 04:23 PM

The application that the work team is working on started throwing errors when I updated datamapper (and the dependent gems) from 1.0.2 to 1.1.0
I wrote this simple code to isolate the problem. It works fine with 1.0.2 but throws an error with 1.1.0

require 'rubygems'
require 'datamapper'

puts "hello 1"
DataMapper::Logger.new("test.log", :debug)
DataMapper.setup(:default, 'oracle://user:password@webtest1')

class TestTab

include DataMapper::Resource

property :tab_id, Integer, :key => true property :name, String, :length => 20 property :desc, String, :length => 20 end

DataMapper.finalize
TestTab.auto_migrate!

@testTab = TestTab.new(:tab_id => 1, :name => 'One', :desc => 'One Again') @testTab.save @testTab = TestTab.new(:tab_id => 2, :name => 'Two', :desc => 'Two Again') @testTab.save

t = TestTab.first
puts ":#{t.desc}:"

With 1.0.2 the output is:

:!ruby test2.rb hello 1
DataObjects::URI.new with arguments is deprecated, use a Hash of URI components

(/usr/local/lib/ruby/gems/1.9.1/gems/dm-do-adapter-1.0.2/lib/dm-do-adapter/adapter.rb:215:in `new') :One Again:

With 1.1.0 the output is:

/home/afernandes/test_gems/test_dm-->ruby test2.rb hello 1
DataObjects::URI.new with arguments is deprecated, use a Hash of URI components (/usr/local/lib/ruby/gems/1.9.1/gems/dm-do-adapter-1.1.0/lib/dm-do-adapter/adapter.rb:231:in new') /usr/local/lib/ruby/gems/1.9.1/gems/dm-oracle-adapter-1.1.0/lib/dm-oracle-adapter/adapter.rb:105:inselect_statement': undefined method `blank?' for nil:NilClass (NoMethodError)

    from /usr/local/lib/ruby/gems/1.9.1/gems/dm-do-adapter-1.1.0/lib/dm-do-adapter/adapter.rb:137:in `read'
    from /usr/local/lib/ruby/gems/1.9.1/gems/dm-core-1.1.0/lib/dm-core/repository.rb:162:in `read'
    from /usr/local/lib/ruby/gems/1.9.1/gems/dm-core-1.1.0/lib/dm-core/model.rb:370:in `first'
    from test2.rb:26:in `<main>'

/home/afernandes/test_gems/test_dm-->


I do understand that the warning about the Hash has been fixed in 1.1.1, but I could not find any information as to why the error "undefined method `blank?' for nil:NilClass (NoMethodError)" was showing up.

Any help would be appreciated. I am not a seasoned ruby developer and could have missed something.

Thank you :-)

Comments and changes to this ticket

  • aferns

    aferns June 2nd, 2011 @ 04:29 PM

    I should have checked the "formatting help".

    There are two requires (rubygems and datamapper) before the puts statement in the code snippet.
    "require 'rubygems'" "require 'datamapper'"

  • fmezas

    fmezas June 9th, 2011 @ 04:35 PM

    blank? is not a ruby method. I believe it's an extension to Object added by rails. Not sure about why the datamapper oracle adapter expects it to be available.

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

Pages