From 74aae2ad573118b46522c65b5f682da6a8d8c8e2 Mon Sep 17 00:00:00 2001 From: hukl Date: Sun, 29 Mar 2009 16:35:33 +0200 Subject: minor refactor --- app/models/page.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'app') 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 options = default_options.merge options translations = self.globalize_translations - locales = translations.map {|l| l.locale} default = *(translations.select {|x| x.locale == I18n.default_locale}) custom = *(translations.select {|x| x.locale == options[:locale]}) if translations.size > 1 && default && custom - time = default.updated_at - custom.updated_at - difference = time.to_i.abs + difference = (default.updated_at - custom.updated_at).to_i.abs return (options[:delta_time].to_i.abs < difference) else return false -- cgit v1.3