Forum: Ruby on Rails [ANN] acts_as_comparable 1.2 released

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
F86901feca747abbb5c6c020362ef2e7?d=identicon&s=25 zdennis (Guest)
on 2007-06-30 23:04
(Received via mailing list)
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_a...

To install as a plugin:
  script/plugin install
http://rails.lotswholetime.com/svn/acts_as_compara...

To install as a gem:
  gem install -r acts_as_comparable

Enjoy!

Zach
4860b9e566ad75803b20affd532c669e?d=identicon&s=25 Mark (Guest)
on 2007-07-01 08:37
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_a...
>
> To install as a plugin:
>   script/plugin install
> http://rails.lotswholetime.com/svn/acts_as_compara...
>
> To install as a gem:
>   gem install -r acts_as_comparable
>
> Enjoy!
>
> Zach
3bef3fc4d0cbcf58f3d66c106e2fd16f?d=identicon&s=25 Mark Van Holstyn (Guest)
on 2007-07-01 15:34
(Received via mailing list)
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 <rails-mailing-list@andreas-s.net> wrote:
>
> >
> >   script/plugin install
>
> --
> Posted via http://www.ruby-forum.com/.
>
> >
>


--
Mark Van Holstyn, Partner / Software Developer
mvanholstyn@mutuallyhuman.com, (616) 706-6842
Mutually Human Software, http://mutuallyhuman.com
4860b9e566ad75803b20affd532c669e?d=identicon&s=25 Mark (Guest)
on 2007-07-02 02:14
> 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
3bef3fc4d0cbcf58f3d66c106e2fd16f?d=identicon&s=25 Mark Van Holstyn (Guest)
on 2007-07-02 14:32
(Received via mailing list)
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 <rails-mailing-list@andreas-s.net> wrote:
> --
> Mark
>
> --
> Posted via http://www.ruby-forum.com/.
>
> >
>


--
Mark Van Holstyn, Partner / Software Developer
mvanholstyn@mutuallyhuman.com, (616) 706-6842
Mutually Human Software, http://mutuallyhuman.com
This topic is locked and can not be replied to.