Avoid creating singleton classes on nil, true and false objects. Instead extend their respective classes. Just because those objects are singletons in current Ruby implementations doesn't mean we should rely on that. Fixes liquid on Maglev.

This commit is contained in:
Tim Felgentreff
2011-06-13 18:13:47 +02:00
parent bc55c4d348
commit c7033ff4c8
+13 -7
View File
@@ -43,14 +43,20 @@ class Date # :nodoc:
end
end
def true.to_liquid # :nodoc:
self
class TrueClass
def to_liquid # :nodoc:
self
end
end
def false.to_liquid # :nodoc:
self
class FalseClass
def to_liquid # :nodoc:
self
end
end
def nil.to_liquid # :nodoc:
self
end
class NilClass
def to_liquid # :nodoc:
self
end
end