From f1d732c6d7da2b7718a71513bb9d76313c9fa4ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dorian=20Mari=C3=A9?= Date: Thu, 12 Mar 2015 14:04:26 +0100 Subject: [PATCH] Add doc for devs about Liquid.cache_classes --- Liquid-for-Programmers.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Liquid-for-Programmers.md b/Liquid-for-Programmers.md index 1ea4818..c8b25a2 100644 --- a/Liquid-for-Programmers.md +++ b/Liquid-for-Programmers.md @@ -113,4 +113,13 @@ Liquid::Template.register_tag('random', Random) text = " {% random 5 %} you have drawn number ^^^, lucky you! {% endrandom %} " @template = Liquid::Template.parse(text) @template.render # will return "you have drawn number 1, lucky you!" in 20% of cases +``` + +## Caching of classes + +If you get errors like `A copy of ... has been removed from the module tree but is still active!` it's probably because Liquid is caching your classes in development mode, the solution is to disable it in test and development modes: + +```ruby +# in config/environments/development.rb and config/environments/test.rb +Liquid.cache_classes = false ``` \ No newline at end of file