# \[ANN\] acts\_as\_comparable 1.2 released

**URL:** <https://www.ruby-forum.com/t/ann-acts-as-comparable-1-2-released/108242>\
**Category:** Rails\
**Created:** [June 30, 2007, 11:04pm UTC](https://www.ruby-forum.com/t/ann-acts-as-comparable-1-2-released/108242 "2007-06-30T23:04:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![zdennis](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/d78d45/32.png) [@zdennis](https://www.ruby-forum.com/u/zdennis)\
**Post date:** [June 30, 2007, 11:04pm UTC](https://www.ruby-forum.com/t/ann-acts-as-comparable-1-2-released/108242/1 "2007-06-30T23:04:11Z")

</div>

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](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](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

---

<div class="post-metadata">

**Author:** ![zdennis](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/d78d45/32.png) [@zdennis](https://www.ruby-forum.com/u/zdennis)\
**Post date:** [July 1, 2007, 8:37am UTC](https://www.ruby-forum.com/t/ann-acts-as-comparable-1-2-released/108242/2 "2007-07-01T08:37:27Z")

</div>

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](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](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

---

<div class="post-metadata">

**Author:** ![zdennis](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/d78d45/32.png) [@zdennis](https://www.ruby-forum.com/u/zdennis)\
**Post date:** [July 2, 2007, 2:14am UTC](https://www.ruby-forum.com/t/ann-acts-as-comparable-1-2-released/108242/3 "2007-07-02T02:14:35Z")

</div>

> 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

---

<div class="post-metadata">

**Author:** ![zdennis](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/d78d45/32.png) [@zdennis](https://www.ruby-forum.com/u/zdennis)\
**Post date:** [July 1, 2007, 3:34pm UTC](https://www.ruby-forum.com/t/ann-acts-as-comparable-1-2-released/108242/4 "2007-07-01T15:34:26Z")

</div>

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 [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > script/plugin install
> 
> –  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).
> 
> >

–  
Mark Van H., Partner / Software Developer  
removed\_email\_address@domain.invalid, (616) 706-6842  
Mutually Human Software, [http://mutuallyhuman.com](http://mutuallyhuman.com)

---

<div class="post-metadata">

**Author:** ![zdennis](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/d78d45/32.png) [@zdennis](https://www.ruby-forum.com/u/zdennis)\
**Post date:** [July 2, 2007, 2:32pm UTC](https://www.ruby-forum.com/t/ann-acts-as-comparable-1-2-released/108242/5 "2007-07-02T14:32:45Z")

</div>

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 [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> –  
> Mark
> 
> –  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).
> 
> >

–  
Mark Van H., Partner / Software Developer  
removed\_email\_address@domain.invalid, (616) 706-6842  
Mutually Human Software, [http://mutuallyhuman.com](http://mutuallyhuman.com)
