Created
February 28, 2009 09:50
-
-
Save will/71929 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
# so ugly, but it makes rails treat CouchRest::Documents correctly | |
class Hash | |
class << self | |
alias :old_trip_equal :=== | |
def ===(other) | |
return false if other.class.ancestors.include?(CouchRest::Document) | |
old_trip_equal other | |
end | |
end | |
end | |
module CouchRest | |
class Document | |
alias :old_kind_of? :kind_of? | |
def kind_of?(o) | |
return false if o == Hash | |
old_kind_of?(o) | |
end | |
alias :old_is_a? :is_a? | |
def is_a?(o) | |
return false if o == Hash | |
old_is_a?(o) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment