diff options
| author | hukl <contact@smyck.org> | 2009-03-29 00:00:47 +0100 |
|---|---|---|
| committer | hukl <contact@smyck.org> | 2009-03-29 00:00:47 +0100 |
| commit | fb25bab7dd0ac761702d23ff60decbca9d03dd56 (patch) | |
| tree | 956517f36ebc20874109cf286c6a3930b652b64a /app/models | |
| parent | b03132fb4c6fa7a2f37005440ac42497d189a6eb (diff) | |
Added unit test to verify the basic functionality of the find_with_outdated_translations method. Found and fixed some issued on the way. [ x ] Testing rocks
Diffstat (limited to 'app/models')
| -rw-r--r-- | app/models/page.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/models/page.rb b/app/models/page.rb index 107ceb9..5f0d389 100644 --- a/app/models/page.rb +++ b/app/models/page.rb | |||
| @@ -72,7 +72,7 @@ class Page < ActiveRecord::Base | |||
| 72 | end | 72 | end |
| 73 | end | 73 | end |
| 74 | 74 | ||
| 75 | def self.find_outdated_translations options = {} | 75 | def self.find_with_outdated_translations options = {} |
| 76 | defaults_options = { | 76 | defaults_options = { |
| 77 | :include => :globalize_translations | 77 | :include => :globalize_translations |
| 78 | } | 78 | } |
| @@ -145,8 +145,8 @@ class Page < ActiveRecord::Base | |||
| 145 | 145 | ||
| 146 | if translations.size > 1 && default && custom | 146 | if translations.size > 1 && default && custom |
| 147 | time = default.updated_at - custom.updated_at | 147 | time = default.updated_at - custom.updated_at |
| 148 | difference = (time/24/3600).to_i.abs | 148 | difference = (time/3600).to_i.abs |
| 149 | if 1 < difference | 149 | if 23 < difference |
| 150 | return true | 150 | return true |
| 151 | else | 151 | else |
| 152 | return false | 152 | return false |
