Erol / ethos

Fast and simple entity library for Ruby
MIT License
2 stars 1 forks source link

Dirty tracking #40

Open Erol opened 9 years ago

Erol commented 9 years ago

Something like this?

user = User.new value: 1
user.attributes.changed? #=> nil

user.value = 2
user.attributes.changed? #=> {value: 2}
user.attributes.changed?(:value) #=> true
Erol commented 9 years ago

Helpers can also be mixed-in to the entity object itself:

user = User.new value: 1
user.changed? #=> nil

user.value = 2
user.changed? #=> {value: 2}
user.changed?(:value) #=> true