I use Ruby on Rails 3, and I have two ActiveRecord objects of the same class account as these:
# Account1 <Account id: 1, name: "Test name 1", surname: "Test surname 1", email: "...", ...>
and
# Account2 <Account id: 2, name: "Test name 2", surname: "Test surname 2", email: "...", ...>
How do you compare each attribute of Account1 with the corresponding attributes of Account2 in several lines of code to check if the values ββare equal? I should get the output "true" if all the values ββof Account1 are equal to the values ββof Account2, otherwise "false", even if only one is different.
source share