Hey everyone -

I apologize for re-opening a year-old thread, but I wanted to check in again 
to see if this feature had been considered by anyone else or whether there 
were any plans to address it.  The implementation I had been using to mark 
an attribute as dirty will be broken (with deprecation notices) again once 
the next version of DM is released.

Currently, the only way to achieve this is by something like the following:

  object.persisted_state = DataMapper::Resource::State::Dirty.new(self) if 
persisted_state.is_a?(DataMapper::Resource::State::Clean)
  property = self.class.properties['name']
  object.persisted_state.original_attributes[property] = name unless 
persisted_state.original_attributes.include?(property)

Obviously this isn't ideal and, as mentioned in the original post, pretty 
brittle.  If there's agreement on how you would want to handle this 
situation in DM, I could certainly look into getting someone to work on it. 
 Just for reference, I'm encountering this in my state_machine library and 
looking into how to really address the latest pull request -- 
https://github.com/pluginaweek/state_machine/pull/106.

Thanks for any thoughts!

-- 
You received this message because you are subscribed to the Google Groups 
"DataMapper" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/datamapper/-/H6nPD0kCWwcJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/datamapper?hl=en.

Reply via email to