public Method

Base.==(comparison_object)

Returns true if the comparison_object is the same object, or is of the same type and has the same id.

Source Code

# File active_record/base.rb, line 2187
def ==(comparison_object)
  comparison_object.equal?(self) ||
    (comparison_object.instance_of?(self.class) &&
      comparison_object.id == id &&
      !comparison_object.new_record?)
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.