Flowdock
method

==

Importance_2
Ruby on Rails latest stable (v6.1.7.7) - 0 notes - Class: ActiveResource::Base

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (v3.2.13) is shown here.

These similar methods exist in v6.1.7.7:

==(other) public

Test for equality. Resource are equal if and only if other is the same object or is an instance of the same class, is not new?, and has the same id.

Examples

ryan = Person.create(:name => 'Ryan')
jamie = Person.create(:name => 'Jamie')

ryan == jamie
# => false (Different name attribute and id)

ryan_again = Person.new(:name => 'Ryan')
ryan == ryan_again
# => false (ryan_again is new?)

ryans_clone = Person.create(:name => 'Ryan')
ryan == ryans_clone
# => false (Different id attributes)

ryans_twin = Person.find(ryan.id)
ryan == ryans_twin
# => true
Show source
Register or log in to add new notes.