Commit fc6053a4b78b872395e9fac17d68673fc9779d54

Authored by Brian van Burken
1 parent 2babec4e
Exists in master and in 1 other branch production

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 80  
81 81 def should_keep?
82 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 87 end
89 88  
90 89 private
... ...