Nested snippets now update correctly, fixes #84

This commit is contained in:
Mario Visic 2011-06-02 21:56:05 +08:00
parent c07dbb3f98
commit 684b1ddf5c

View File

@ -12,11 +12,14 @@ module Locomotive
@slug = @template_name.gsub('\'', '') @slug = @template_name.gsub('\'', '')
@context[:snippets] = [] if @context[:snippets].nil?
(@context[:snippets] << @slug).uniq! (@context[:snippets] << @slug).uniq!
snippet = @context[:site].snippets.where(:slug => @slug).first if @context[:site].present?
snippet = @context[:site].snippets.where(:slug => @slug).first
self.refresh(snippet) if snippet self.refresh(snippet) if snippet
end
end end
def render(context) def render(context)