Created
November 26, 2014 16:58
-
-
Save jasiek/949a4ff486575df44f43 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Equality | |
include ActiveSupport::Concern | |
def ==(other) | |
if self.instance_variables == other.instance_variables | |
self.instance_variables.each do |ivar| | |
return false if self.instance_variable_get(ivar) != self.instance_variable_get(ivar) | |
end | |
true | |
else | |
false | |
end | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Visitor | |
include ActiveModel::Model | |
include Equality | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment