Skip to content

Instantly share code, notes, and snippets.

@jasiek
Created November 26, 2014 16:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasiek/949a4ff486575df44f43 to your computer and use it in GitHub Desktop.
Save jasiek/949a4ff486575df44f43 to your computer and use it in GitHub Desktop.
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
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