June 08, 2006

Posted by John

Tagged plugins

Older: Updates To Active Record Find

Newer: Things Are A Changing

Acts As Versioned With Associations

Richard Livsey has just built functionality on top of Technoweenie’s acts_as_versioned plugin to also version associations.

class Article < ActiveRecord::Base
  has_many :images
  has_and_belongs_to_many :categories

  acts_as_versioned
  acts_as_versioned_association :images
  acts_as_versioned_association :categories
end

Now, not only is the article versioned but also the associations. I can’t quite think of something I would use it on yet, but it is a pretty cool idea. You can read more on Richard’s blog.

0 Comments

Thoughts? Do Tell...


textile enabled, preview above, please be nice
use <pre><code class="ruby"></code></pre> for code blocks

About

Authored by John Nunemaker (Noo-neh-maker), a web developer and programmer who has fallen deeply in love with Ruby. More about John.

Syndication

Feed IconRailsTips Articles - An assortment of howto's and thoughts on Ruby and Rails.

Feed IconRails Quick Tips - Ruby and Rails related links.