
new obj without all fields crashes on calling attributes
Reported by Gary Yngve | December 27th, 2009 @ 11:34 PM | in 1.0.0
!/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 method
reload' 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
-
Dan Kubb (dkubb) February 2nd, 2010 @ 12:38 PM
- State changed from new to not-applicable
- Assigned user cleared.
I cleaned up the script (attached) and wasn't able to reproduce this problem. Marking it as not-applicable. If you can provide a stand-alone script that does reproduce the problem, please attach it to this ticket.
-
Piotr Solnica (solnic) February 2nd, 2010 @ 02:16 PM
This is fixed in master: http://github.com/datamapper/dm-core/commit/3332db6c25ab9cea9ba58ce... I think it's save to mark it as resolved
-
Dan Kubb (dkubb) February 3rd, 2010 @ 12:36 AM
- State changed from not-applicable to resolved
- Assigned user set to Dirkjan Bussink
- Milestone set to 1.0.0
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.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »