[ANN] acts_as_comparable 1.2 released

acts_as_comparable 1.2 has been released. It includes a bug fix for
passing in custom options to the declarative acts_as_comparable call.

What is acts_as_comparable?
acts_as_comparable is plugin for ActiveRecord which allows you to
easily compare and determine the differences between two ActiveRecord
model

For more information see:
http://www.continuousthinking.com/2007/6/30/acts_as_comparable-1-2-released

To install as a plugin:
script/plugin install
http://rails.lotswholetime.com/svn/acts_as_comparable/tags/acts_as_comparable-1.2

To install as a gem:
gem install -r acts_as_comparable

Enjoy!

Zach

I don’t really get the purpose of your plugin. Why would one need a
plugin to tell them that a != b? Like your example:

pet1 = Pet.new :id=>1, :name=>“dog”, :value=>“Tiny”
pet2 = Pet.new :id=>5, :name=>“cat”, :value=>“Norm”

differences = pet1.differences(pet2)
=> {:value=>[“Tiny”, “Norm”], :name=>[“dog”, “cat”], :id=>[1, 5]}

Could you tell us in a real practical example how and why would one use
this plugin?


Mark

zdennis wrote:

acts_as_comparable 1.2 has been released. It includes a bug fix for
passing in custom options to the declarative acts_as_comparable call.

What is acts_as_comparable?
acts_as_comparable is plugin for ActiveRecord which allows you to
easily compare and determine the differences between two ActiveRecord
model

For more information see:
http://www.continuousthinking.com/2007/6/30/acts_as_comparable-1-2-released

To install as a plugin:
script/plugin install
http://rails.lotswholetime.com/svn/acts_as_comparable/tags/acts_as_comparable-1.2

To install as a gem:
gem install -r acts_as_comparable

Enjoy!

Zach

The reason it was originally created was for an audit log. Before saving the model, it was compared to the model that is stored in the database, and then the differences are logged.

Well, if that was the main purpose of your plugin than I’d say the
current version is completely off because you don’t offer an option to
store the differences in a log.


Mark

The reason it was originally created was for an audit log. Before saving
the
model, it was compared to the model that is stored in the database, and
then
the differences are logged.

Mark

On 7/1/07, Mark [email protected] wrote:

script/plugin install


Posted via http://www.ruby-forum.com/.


Mark Van H., Partner / Software Developer
[email protected], (616) 706-6842
Mutually Human Software, http://mutuallyhuman.com

The plugin itself was not meant to store the differences in a log, the
plugin was the mean to offer the developer the ability to compare 2
ActiveRecord objects. Anything could be done with that comparison, like
store a log of changes.

Mark

On 7/1/07, Mark [email protected] wrote:


Mark


Posted via http://www.ruby-forum.com/.


Mark Van H., Partner / Software Developer
[email protected], (616) 706-6842
Mutually Human Software, http://mutuallyhuman.com