Plugins - acts_as_comparable

StarAdd to favorites

acts_as_comparable is an easy way to compare ActiveRecord models based on their attributes.

  class Person
    acts_as_comparable :only=>[:first_name, :last_name]
  end

  joe = Person.new :first_name=>"Joe", :last_name=>"Smith"
  joseph = Person.new :first_name => "Joseph", :last_name=>"Smith"

  joe.same?( joseph ) # => false
  joe.different?( joseph ) # => true

  joe.differences( joseph ) # => {:first_name=>["Joe", "Joseph"]}

Mark Van Holstyn, Zach Dennis

http://www.continuousthinking.com/2007/4/21/introducing-acts_as_comparable

http://rails.lotswholetime.com/svn/acts_as_comparable

Rails' (MIT)

  • Currently 3.0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Model

Tags

Comments

Add a comment
Peter Boling 8 Mar 2008
I am unable to get to the repository for the plugin install... svn: PROPFIND of '/svn/acts_as_comparable/tags/acts_as_comparable-1.2': Could not resolve hostname `rails.lotswholetime.com': Host not found (http://rails.lotswholetime.com)

Search Plugins

Query syntax

Plugins by Category

Sponsors

Rails Kits: Get Code. Get Moving.

Have a comment?