Corrected with rubocop cop 'Style/Next'.

This commit is contained in:
Thorsten Eckel 2015-05-07 11:59:10 +02:00
parent c282fd2b37
commit d8190dc5b4
2 changed files with 10 additions and 8 deletions

View file

@ -8,9 +8,10 @@ module Channel::Filter::Trusted
# check if trust x-headers
if !channel[:trusted]
mail.each {|key, _value|
if key =~ /^x-zammad/i
mail.delete(key)
end
next if key !~ /^x-zammad/i
mail.delete(key)
}
end

View file

@ -31,11 +31,12 @@ module Ticket::Number::Increment
min_digs = min_digs.to_i - 1
end
fillup = Setting.get('system_id') || '1'
( 1..100 ).each do |_i|
if ( fillup.length.to_i + counter_increment.to_s.length.to_i ) < min_digs.to_i
fillup = fillup + '0'
end
end
( 1..100 ).each {
next if ( fillup.length.to_i + counter_increment.to_s.length.to_i ) >= min_digs.to_i
fillup = fillup + '0'
}
number = fillup.to_s + counter_increment.to_s
# calculate a checksum