https://github.com/solnic/virtus-dirty_tracking
ABANDONED - MOVE ON
https://github.com/solnic/virtus-dirty_tracking
Last synced: 27 days ago
JSON representation
ABANDONED - MOVE ON
- Host: GitHub
- URL: https://github.com/solnic/virtus-dirty_tracking
- Owner: solnic
- License: mit
- Created: 2011-06-04T12:30:16.000Z (almost 14 years ago)
- Default Branch: master
- Last Pushed: 2011-10-13T14:50:36.000Z (over 13 years ago)
- Last Synced: 2025-04-18T15:16:41.544Z (about 1 month ago)
- Language: Ruby
- Homepage: https://github.com/solnic/virtus-dirty_tracking
- Size: 130 KB
- Stars: 6
- Watchers: 1
- Forks: 19
- Open Issues: 1
-
Metadata Files:
- Readme: README.rdoc
- License: LICENSE
Awesome Lists containing this project
README
= Virtus - Dirty Tracking
Support for dirty tracking of virtus attributes.
== Usage
class Post
include Virtus
include Virtus::DirtyTrackingattribute :title, String
attribute, :content, String
attribute, :meta, Hash
endpost = Post.new(:title => 'Foo', :meta => { :tags => ['red', 'green'] })
post.title = 'Bar'
post.dirty? # => true
post.attribute_dirty?(:title) # => true
post.meta[:tags] << 'blue'
post.attribute_dirty?(:meta) # => true
post.dirty_attributes # => {:title => 'Bar', :meta=>{:tags=>["red", "green", "blue"]}}
== Note on Patches/Pull Requests
* Fork the project.
* Make your feature addition or bug fix.
* Add tests for it. This is important so I don't break it in a
future version unintentionally.
* Commit, do not mess with rakefile, version, or history.
(if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
* Send me a pull request. Bonus points for topic branches.== Copyright
Copyright (c) 2011 Piotr Solnica. See LICENSE for details.