Skip to content

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

License

Notifications You must be signed in to change notification settings

openhood/dirty_associations

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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!

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages