Skip to content

Commit

Permalink
Change the default compare operator in Partition class
Browse files Browse the repository at this point in the history
  • Loading branch information
AhmedKamal1432 committed Aug 18, 2015
1 parent 4c2d57b commit 6abd64f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/models/partition.rb
Expand Up @@ -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

0 comments on commit 6abd64f

Please sign in to comment.