Commit fc6053a4b78b872395e9fac17d68673fc9779d54
1 parent
2babec4e
Exists in
master
and in
1 other branch
Cleaned the long unreadable statement into smaller seperate lines.
Showing
1 changed file
with
4 additions
and
5 deletions
Show diff stats
app/models/error_report.rb
| @@ -80,11 +80,10 @@ class ErrorReport | @@ -80,11 +80,10 @@ class ErrorReport | ||
| 80 | 80 | ||
| 81 | def should_keep? | 81 | def should_keep? |
| 82 | app_version = server_environment['app-version'] || '' | 82 | app_version = server_environment['app-version'] || '' |
| 83 | - if self.app.current_app_version.present? && ( app_version.length <= 0 || Gem::Version.new(app_version) < Gem::Version.new(self.app.current_app_version) ) | ||
| 84 | - false | ||
| 85 | - else | ||
| 86 | - true | ||
| 87 | - end | 83 | + current_version = app.current_app_version |
| 84 | + return true unless current_version.present? | ||
| 85 | + return false if app_version.length <= 0 | ||
| 86 | + Gem::Version.new(app_version) >= Gem::Version.new(current_version) | ||
| 88 | end | 87 | end |
| 89 | 88 | ||
| 90 | private | 89 | private |