I'm using DataMapper as ORM framework after many years of experience with AR. For that reason I sometimes try to find a specific DM function that mirrors some behaviour from AR. Sometimes I'm lucky, sometimes I'm not. With the #reload directive, I'm kind of in a limbo. The method exists, but somehow doesn't do what I expected it to. Basically, instead of the AR behaviour in which the instance attributes would be updated looking up to the DB, DM somehow marks every attributes from the instance as "not loaded".
Can somebody tell me if this is possible to achieve using DM?
DataMapper marks the attributes as not loaded and will load them on the next access.
This is a result from support of lazy loading groups. DM-1 will wait to see what attribute is accessed next to load only a limited set of attributes.
Per default all attributes are in the :default group, so most likely all attributes are loaded once you hit one.
In case this lazy behavior is not wanted you can do the following: