
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 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 5th, 2010 @ 03:05 AM
- State changed from new to not-applicable
This works with edge dm-core. Attached is the same code as above, cleaned up, and it works fine.
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 »