#1167 ✓not-applicable
Gary Yngve

new obj without all fields crashes on calling attributes

Reported by Gary Yngve | December 27th, 2009 @ 11:33 PM

!/usr/bin/env ruby

require 'rubygems'

gem 'dm-core', '~>0.10.2'
require 'dm-core'

DataMapper::Logger.new(STDOUT, :debug)
DataMapper.setup(:default, 'sqlite3::memory:')

class Blah
include DataMapper::Resource property :id, String, :key => true property :foo, String end

DataMapper.auto_migrate!

b=Blah.new(:id => 'qwe')
puts b.attributes.inspect

/Library/Ruby/Gems/1.8/gems/dm-core-0.10.2/lib/dm-core/resource.rb:766:in eager_load': undefined methodreload' for nil:NilClass (NoMethodError)

from /Library/Ruby/Gems/1.8/gems/dm-core-0.10.2/lib/dm-core/resource.rb:752:in lazy_load'

from /Library/Ruby/Gems/1.8/gems/dm-core-0.10.2/lib/dm-core/resource.rb:250:in attributes'

from after_save.rb:20

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

Attachments

Pages