From e2f60f2e15a43f0a62e6887436737098a4102dd4 Mon Sep 17 00:00:00 2001 From: did Date: Mon, 19 Mar 2012 09:15:12 -0700 Subject: [PATCH] the template of related pages were not updated for the non default locale --- app/models/locomotive/extensions/page/parse.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/models/locomotive/extensions/page/parse.rb b/app/models/locomotive/extensions/page/parse.rb index eb52491e..d73c3da5 100644 --- a/app/models/locomotive/extensions/page/parse.rb +++ b/app/models/locomotive/extensions/page/parse.rb @@ -60,8 +60,8 @@ module Locomotive @template = ::Liquid::Template.parse(self.raw_template, context) - self.template_dependencies = context[:templates] - self.snippet_dependencies = context[:snippets] + self.template_dependencies = context[:templates] + self.snippet_dependencies = context[:snippets] @template.root.context.clear end @@ -77,7 +77,7 @@ module Locomotive return unless @template_changed == true # we admit at this point that the current template is up-to-date - template_descendants = self.site.pages.any_in(:template_dependencies => [self.id]).to_a + template_descendants = self.site.pages.any_in("template_dependencies.#{::Mongoid::Fields::I18n.locale}" => [self.id]).to_a # group them by fullpath for better performance cached = template_descendants.inject({}) { |memo, page| memo[page.fullpath] = page; memo }