From 6abd64f4188d531a3e4c692ab035ae2ae909d390 Mon Sep 17 00:00:00 2001 From: Ahmed Kamal Date: Sun, 16 Aug 2015 06:08:01 +0300 Subject: [PATCH] Change the default compare operator in Partition class --- app/models/partition.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/models/partition.rb b/app/models/partition.rb index 1a50dcc..1d6b8db 100755 --- a/app/models/partition.rb +++ b/app/models/partition.rb @@ -116,6 +116,11 @@ def device return Device.find "/dev/#{parent_kname}" end + # Change the default compare operator to be able to compare with object correctly + def ==(other_part) + self.uuid == other_part.uuid and self.kname == other_part.kname and self.size == other_part.size + end + private end