Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Simple plugin to track changes in associations. Fully working, with proper specs to prove it, tested under Rails 2.1, 2.2 and 2.3
Ruby
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
spec
.gitignore
MIT-LICENSE
README.textile
Rakefile
init.rb

README.textile

Dirty Associations

Simple plugin to track changes in associations. Fully working, with proper specs to prove it, tested under Rails 2.1, 2.2 and 2.3

Example

class MommyChicken < ActiveRecord::Base has_many :little_chickens dirty_associations :little_chickens end class LittleChicken < ActiveRecord::Base end

and then you can do:

@mommy = MommyChicken.create(:name => “Gertrude”) @mommy.little_chickens.build(:name => “Junior”) @mommy.little_chickens_changed? → true @mommy.little_chickens_was → []

Does now also mixin with ActiveRecord::Dirty to override changed, changed?, changes, and reload_with_dirty.

Enjoy!

Something went wrong with that request. Please try again.