Giter Site home page Giter Site logo

Comments (3)

postmodern avatar postmodern commented on July 23, 2024
ArgumentError: +value+ must be nil or a String
    from /home/hal/.rvm/gems/ruby-1.9.2-p290/gems/dm-types-1.2.0/lib/dm-types/ip_address.rb:28:in `load'
    from /home/hal/.rvm/gems/ruby-1.9.2-p290/gems/dm-types-1.2.0/lib/dm-types/ip_address.rb:37:in `typecast_to_primitive'
    from /home/hal/.rvm/gems/ruby-1.9.2-p290/gems/dm-core-1.2.0/lib/dm-core/property.rb:686:in `typecast'
    from /home/hal/.rvm/gems/ruby-1.9.2-p290/gems/dm-core-1.2.0/lib/dm-core/property.rb:625:in `set'
    from /home/hal/.rvm/gems/ruby-1.9.2-p290/gems/dm-core-1.2.0/lib/dm-core/resource/persistence_state.rb:22:in `set'
    from /home/hal/.rvm/gems/ruby-1.9.2-p290/gems/dm-core-1.2.0/lib/dm-core/resource/persistence_state/transient.rb:14:in `set'
    from /home/hal/.rvm/gems/ruby-1.9.2-p290/gems/dm-core-1.2.0/lib/dm-core/model/property.rb:237:in `address='
    from /home/hal/.rvm/gems/ruby-1.9.2-p290/gems/dm-core-1.2.0/lib/dm-core/resource.rb:333:in `block in attributes='
    from /home/hal/.rvm/gems/ruby-1.9.2-p290/gems/dm-core-1.2.0/lib/dm-core/resource.rb:329:in `each'
    from /home/hal/.rvm/gems/ruby-1.9.2-p290/gems/dm-core-1.2.0/lib/dm-core/resource.rb:329:in `attributes='
    from /home/hal/.rvm/gems/ruby-1.9.2-p290/gems/dm-core-1.2.0/lib/dm-core/resource.rb:748:in `initialize'
    from /home/hal/.rvm/gems/ruby-1.9.2-p290/gems/dm-core-1.2.0/lib/dm-core/property/discriminator.rb:33:in `new'
    from /home/hal/.rvm/gems/ruby-1.9.2-p290/gems/dm-core-1.2.0/lib/dm-core/property/discriminator.rb:33:in `new'

from dm-types.

solnic avatar solnic commented on July 23, 2024

@postmodern can you reproduce it on current master?

from dm-types.

postmodern avatar postmodern commented on July 23, 2024

Confirmed on master (ddf9682):

require 'dm-core'
require 'dm-types'
require 'resolv'

class Test
  include DataMapper::Resource

  property :id, Serial
  property :ip, IPAddress
end
DataMapper.finalize

ip = Resolv::DNS.new(:nameserver => '4.2.2.1').getaddress('www.google.com')
t = Test.new(:ip => ip)
ArgumentError: +value+ must be nil or a String
    from /home/hal/.rvm/gems/ruby-1.9.2-p290/bundler/gems/dm-types-ddf96829985c/lib/dm-types/ip_address.rb:21:in `load'
    from /home/hal/.rvm/gems/ruby-1.9.2-p290/bundler/gems/dm-types-ddf96829985c/lib/dm-types/ip_address.rb:30:in `typecast'
    from /home/hal/.rvm/gems/ruby-1.9.2-p290/bundler/gems/dm-core-d74ae6e8c4a3/lib/dm-core/property.rb:618:in `set'
    from /home/hal/.rvm/gems/ruby-1.9.2-p290/bundler/gems/dm-core-d74ae6e8c4a3/lib/dm-core/resource/persistence_state.rb:22:in `set'
    from /home/hal/.rvm/gems/ruby-1.9.2-p290/bundler/gems/dm-core-d74ae6e8c4a3/lib/dm-core/resource/persistence_state/transient.rb:14:in `set'
    from /home/hal/.rvm/gems/ruby-1.9.2-p290/bundler/gems/dm-core-d74ae6e8c4a3/lib/dm-core/model/property.rb:237:in `ip='
    from /home/hal/.rvm/gems/ruby-1.9.2-p290/bundler/gems/dm-core-d74ae6e8c4a3/lib/dm-core/resource.rb:333:in `block in attributes='
    from /home/hal/.rvm/gems/ruby-1.9.2-p290/bundler/gems/dm-core-d74ae6e8c4a3/lib/dm-core/resource.rb:329:in `each'
    from /home/hal/.rvm/gems/ruby-1.9.2-p290/bundler/gems/dm-core-d74ae6e8c4a3/lib/dm-core/resource.rb:329:in `attributes='
    from /home/hal/.rvm/gems/ruby-1.9.2-p290/bundler/gems/dm-core-d74ae6e8c4a3/lib/dm-core/resource.rb:748:in `initialize'
    from (irb):16:in `new'
    from (irb):16
    from /home/hal/.rvm/rubies/ruby-1.9.2-p290/bin/irb:16:in `'

from dm-types.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.