#1066 ✓resolved

dm-core 0.10.1 does not handle redefining of properties in sub-models.

Reported by Postmodern | September 30th, 2009 @ 05:46 PM | in 0.10.2

I noticed that when re-defining properties in sub-models, dm-core 0.10.1 property crashes.

require 'dm-core'

class User

  include DataMapper::Resource

  property :id, Serial

  property :name, String


class Admin < User

  property :name, String


DataMapper.setup(:default, 'sqlite3::memory:')
$ ruby dm_bug.rb 
/usr/lib64/ruby/gems/1.8/gems/dm-core-0.10.1/lib/dm-core/property_set.rb:49:in `super_slice': no implicit conversion from nil to integer (TypeError)
    from /usr/lib64/ruby/gems/1.8/gems/dm-core-0.10.1/lib/dm-core/property_set.rb:49:in `<<'
    from /usr/lib64/ruby/gems/1.8/gems/dm-core-0.10.1/lib/dm-core/model/property.rb:53:in `property'
    from dm_bug.rb:15

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