Class: ApplicationRecord

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/application_record.rb

Overview

Abstract class to hold common methods for application models

Instance Method Summary collapse

Instance Method Details

#==(other) ⇒ Object

Redefine equality for application records Rather than just checking for equal IDs, check that all attributes are equal.


9
10
11
# File 'app/models/application_record.rb', line 9

def ==(other)
  return attributes == other.attributes if other
end