fix issue with snippet dependencies
This commit is contained in:
parent
eabe4903f3
commit
dd0a09ec4d
@ -61,7 +61,7 @@ module Models
|
||||
context = default_context.merge(context)
|
||||
|
||||
@template = ::Liquid::Template.parse(self.raw_template, context)
|
||||
|
||||
|
||||
self.template_dependencies = context[:templates]
|
||||
self.snippet_dependencies = context[:snippets]
|
||||
|
||||
|
@ -32,13 +32,15 @@ class Snippet
|
||||
end
|
||||
|
||||
def update_templates
|
||||
return unless (self.site rescue nil) # not run if the site is being destroyed
|
||||
|
||||
return unless (self.site rescue false) # not run if the site is being destroyed
|
||||
|
||||
pages = self.site.pages.any_in(:snippet_dependencies => [self.slug]).to_a
|
||||
|
||||
pages.each do |page|
|
||||
self._change_snippet_inside_template(page.template.root)
|
||||
|
||||
page.instance_variable_set(:@template_changed, true)
|
||||
|
||||
page.send(:_serialize_template) && page.save
|
||||
end
|
||||
end
|
||||
|
3
doc/TODO
3
doc/TODO
@ -27,9 +27,10 @@ x import tool:
|
||||
x disable sub tasks by passing options
|
||||
x exceptions
|
||||
x page to import theme
|
||||
x snippet dependencies => do not work correctly
|
||||
- global regions: keyword in editable element (http://www.mongodb.org/display/DOCS/Updating)
|
||||
- write my first tutorial about locomotive
|
||||
- snippet dependencies => do not work correctly
|
||||
|
||||
|
||||
- refactor slugify method (use parameterize + create a module)
|
||||
- [content types] the "display column" selector should not include file types
|
||||
|
Loading…
Reference in New Issue
Block a user