summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/models/page.rb4
1 files changed, 1 insertions, 3 deletions
diff --git a/app/models/page.rb b/app/models/page.rb
index b11b43c..dfabecf 100644
--- a/app/models/page.rb
+++ b/app/models/page.rb
@@ -148,14 +148,12 @@ class Page < ActiveRecord::Base
148 options = default_options.merge options 148 options = default_options.merge options
149 149
150 translations = self.globalize_translations 150 translations = self.globalize_translations
151 locales = translations.map {|l| l.locale}
152 151
153 default = *(translations.select {|x| x.locale == I18n.default_locale}) 152 default = *(translations.select {|x| x.locale == I18n.default_locale})
154 custom = *(translations.select {|x| x.locale == options[:locale]}) 153 custom = *(translations.select {|x| x.locale == options[:locale]})
155 154
156 if translations.size > 1 && default && custom 155 if translations.size > 1 && default && custom
157 time = default.updated_at - custom.updated_at 156 difference = (default.updated_at - custom.updated_at).to_i.abs
158 difference = time.to_i.abs
159 return (options[:delta_time].to_i.abs < difference) 157 return (options[:delta_time].to_i.abs < difference)
160 else 158 else
161 return false 159 return false