
update assumes non-loaded lazy properties are null if not already loaded
Reported by Nathan | September 13th, 2009 @ 09:47 PM
Calling update on a Resource where a key to update is a lazy loaded property not yet loaded, update returns false and doesn't update all the properties.
class Story
include DataMapper::Resource
property :id, Serial
property :body, Text
end
s = Story.first
s.update({ "body"=>"something"}) # => false
s.original_attributes # => {#[DataMapper::Property @model=Story @name=:body]=]nil}
This applies to the next branch as of the date/time of this ticket.
(replaced angles with [] because lighthouse eats them as tags)
Comments and changes to this ticket
-
Jonathan Stott (namelessjon) October 11th, 2009 @ 05:33 AM
- State changed from new to resolved
The attached script suggests this has been fixed since the ticket was filed. Marking this as resolved, but please feel free to reopen the ticket if the problem is still there for you.
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 »