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
+9 -3
View File
@@ -43,14 +43,20 @@ class Date # :nodoc:
end end
end end
def true.to_liquid # :nodoc: class TrueClass
def to_liquid # :nodoc:
self self
end end
end
def false.to_liquid # :nodoc: class FalseClass
def to_liquid # :nodoc:
self self
end end
end
def nil.to_liquid # :nodoc: class NilClass
def to_liquid # :nodoc:
self self
end end
end