diff options
| author | hukl <contact@smyck.org> | 2009-03-29 14:14:56 +0200 |
|---|---|---|
| committer | hukl <contact@smyck.org> | 2009-03-29 14:14:56 +0200 |
| commit | c2fa7429dfb10a018731320a49e7ea061feef784 (patch) | |
| tree | ec124ffbacace269e38911f62103d6ecd9406d75 /app/models/page.rb | |
| parent | 14eae971ba9a385442d5950288f2a74511c09baa (diff) | |
a few more assertions
Diffstat (limited to 'app/models/page.rb')
| -rw-r--r-- | app/models/page.rb | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/app/models/page.rb b/app/models/page.rb index ee1e70a..b11b43c 100644 --- a/app/models/page.rb +++ b/app/models/page.rb | |||
| @@ -134,7 +134,7 @@ class Page < ActiveRecord::Base | |||
| 134 | end | 134 | end |
| 135 | 135 | ||
| 136 | # Returns true if a page has translations where one of them is significantly | 136 | # Returns true if a page has translations where one of them is significantly |
| 137 | # older than the other | 137 | # older than the other. |
| 138 | # Takes the I18n.default locale and a second :locale to test if the | 138 | # Takes the I18n.default locale and a second :locale to test if the |
| 139 | # translations for the given locales exist and if their updated_at attributes | 139 | # translations for the given locales exist and if their updated_at attributes |
| 140 | # have a delta time that is greater than the specified :delta_time | 140 | # have a delta time that is greater than the specified :delta_time |
| @@ -156,8 +156,7 @@ class Page < ActiveRecord::Base | |||
| 156 | if translations.size > 1 && default && custom | 156 | if translations.size > 1 && default && custom |
| 157 | time = default.updated_at - custom.updated_at | 157 | time = default.updated_at - custom.updated_at |
| 158 | difference = time.to_i.abs | 158 | difference = time.to_i.abs |
| 159 | 159 | return (options[:delta_time].to_i.abs < difference) | |
| 160 | return (options[:delta_time].abs < difference) | ||
| 161 | else | 160 | else |
| 162 | return false | 161 | return false |
| 163 | end | 162 | end |
