stevenbeales/mental-test

View on GitHub
app/models/application_record.rb

Summary

Maintainability
A
0 mins
Test Coverage
# frozen_string_literal: true

# Abstract class to hold common methods for application models
class ApplicationRecord < ActiveRecord::Base
  self.abstract_class = true
  
  # Redefine equality for application records
  # Rather than just checking for equal IDs, check that all attributes are equal.
  def ==(other)
    return attributes == other.attributes if other
  end
end