Allow tag classes to be reloaded when using Liquid.cache_classes is false

Because Liquid keeps a reference to tag classes, Rails class reloading may
cause problems with custom tags. This commit introduces a setting that
allows these classes to be resolved when required.
This commit is contained in:
David Cornu
2014-07-02 20:03:18 +00:00
parent d007c50856
commit f57383af37
3 changed files with 84 additions and 1 deletions
+3
View File
@@ -38,6 +38,9 @@ module Liquid
PartialTemplateParser = /#{TagStart}.*?#{TagEnd}|#{VariableStart}.*?#{VariableIncompleteEnd}/om
TemplateParser = /(#{PartialTemplateParser}|#{AnyStartingTag})/om
VariableParser = /\[[^\]]+\]|#{VariableSegment}+\??/o
singleton_class.send(:attr_accessor, :cache_classes)
self.cache_classes = true
end
require "liquid/version"