mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-12 23:40:45 -07:00
Add doc for devs about Liquid.cache_classes
@@ -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
|
||||
```
|
||||
Reference in New Issue
Block a user