Some new rubocop checks.
This commit is contained in:
parent
6909430eac
commit
c694f2f37e
11 changed files with 17 additions and 17 deletions
|
@ -62,7 +62,7 @@ module Ticket::Number::Date
|
||||||
end
|
end
|
||||||
number += chksum.to_s
|
number += chksum.to_s
|
||||||
end
|
end
|
||||||
return number
|
number
|
||||||
end
|
end
|
||||||
def check(string)
|
def check(string)
|
||||||
|
|
||||||
|
@ -78,6 +78,6 @@ module Ticket::Number::Date
|
||||||
elsif string =~ /#{ticket_hook}\s{0,2}(#{system_id}\d{2,50})/i then
|
elsif string =~ /#{ticket_hook}\s{0,2}(#{system_id}\d{2,50})/i then
|
||||||
ticket = Ticket.where( number: $1 ).first
|
ticket = Ticket.where( number: $1 ).first
|
||||||
end
|
end
|
||||||
return ticket
|
ticket
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -9,7 +9,7 @@ module Ticket::Number::Increment
|
||||||
config = Setting.get('ticket_number_increment')
|
config = Setting.get('ticket_number_increment')
|
||||||
|
|
||||||
# read counter
|
# read counter
|
||||||
min_digs = config[:min_size] || 4;
|
min_digs = config[:min_size] || 4
|
||||||
counter_increment = nil
|
counter_increment = nil
|
||||||
Ticket::Counter.transaction do
|
Ticket::Counter.transaction do
|
||||||
counter = Ticket::Counter.where( generator: 'Increment' ).lock(true).first
|
counter = Ticket::Counter.where( generator: 'Increment' ).lock(true).first
|
||||||
|
@ -65,7 +65,7 @@ module Ticket::Number::Increment
|
||||||
end
|
end
|
||||||
number += chksum.to_s
|
number += chksum.to_s
|
||||||
end
|
end
|
||||||
return number
|
number
|
||||||
end
|
end
|
||||||
|
|
||||||
def check(string)
|
def check(string)
|
||||||
|
@ -82,6 +82,6 @@ module Ticket::Number::Increment
|
||||||
elsif string =~ /#{ticket_hook}\s{0,2}(#{system_id}\d{2,48})/i then
|
elsif string =~ /#{ticket_hook}\s{0,2}(#{system_id}\d{2,48})/i then
|
||||||
ticket = Ticket.where( number: $1 ).first
|
ticket = Ticket.where( number: $1 ).first
|
||||||
end
|
end
|
||||||
return ticket
|
ticket
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -181,7 +181,7 @@ returns
|
||||||
where( _condition( overview_selected.condition ) ).
|
where( _condition( overview_selected.condition ) ).
|
||||||
count()
|
count()
|
||||||
|
|
||||||
return {
|
{
|
||||||
tickets: tickets,
|
tickets: tickets,
|
||||||
tickets_count: tickets_count,
|
tickets_count: tickets_count,
|
||||||
overview: overview_selected_raw,
|
overview: overview_selected_raw,
|
||||||
|
@ -245,6 +245,6 @@ returns
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
bind[0] = sql
|
bind[0] = sql
|
||||||
return bind
|
bind
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -41,7 +41,7 @@ returns
|
||||||
data[:current_user].groups.each {|group|
|
data[:current_user].groups.each {|group|
|
||||||
return true if self.group.id == group.id
|
return true if self.group.id == group.id
|
||||||
}
|
}
|
||||||
return false
|
false
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -113,7 +113,7 @@ returns
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
{
|
||||||
assets: assets,
|
assets: assets,
|
||||||
filter: filter,
|
filter: filter,
|
||||||
dependencies: dependencies,
|
dependencies: dependencies,
|
||||||
|
@ -167,7 +167,7 @@ returns
|
||||||
assets = ticket.assets(assets)
|
assets = ticket.assets(assets)
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
{
|
||||||
ticket_ids_open: ticket_ids_open,
|
ticket_ids_open: ticket_ids_open,
|
||||||
ticket_ids_closed: ticket_ids_closed,
|
ticket_ids_closed: ticket_ids_closed,
|
||||||
assets: assets,
|
assets: assets,
|
||||||
|
|
|
@ -52,7 +52,7 @@ returns
|
||||||
limit = params[:limit] || 12
|
limit = params[:limit] || 12
|
||||||
current_user = params[:current_user]
|
current_user = params[:current_user]
|
||||||
full = false
|
full = false
|
||||||
if params[:full] || !params.has_key?(:full)
|
if params[:full] || !params.key?(:full)
|
||||||
full = true
|
full = true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -140,7 +140,7 @@ returns
|
||||||
tickets_all.each { |ticket|
|
tickets_all.each { |ticket|
|
||||||
tickets.push Ticket.lookup( id: ticket.id )
|
tickets.push Ticket.lookup( id: ticket.id )
|
||||||
}
|
}
|
||||||
return tickets
|
tickets
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -48,6 +48,6 @@ returns:
|
||||||
def ignore_escalation?
|
def ignore_escalation?
|
||||||
ignore_escalation = ['removed', 'closed', 'merged']
|
ignore_escalation = ['removed', 'closed', 'merged']
|
||||||
return true if ignore_escalation.include?( self.name )
|
return true if ignore_escalation.include?( self.name )
|
||||||
return false
|
false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -73,6 +73,6 @@ returns
|
||||||
subject = subject[ 0, ticket_subject_size.to_i ] + '[...]'
|
subject = subject[ 0, ticket_subject_size.to_i ] + '[...]'
|
||||||
end
|
end
|
||||||
|
|
||||||
return subject
|
subject
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -30,7 +30,7 @@ returns
|
||||||
# check agent
|
# check agent
|
||||||
return true if data[:current_user].is_role(Z_ROLENAME_ADMIN)
|
return true if data[:current_user].is_role(Z_ROLENAME_ADMIN)
|
||||||
return true if data[:current_user].is_role('Agent')
|
return true if data[:current_user].is_role('Agent')
|
||||||
return false
|
false
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -50,7 +50,7 @@ returns
|
||||||
'(firstname LIKE ? or lastname LIKE ? or email LIKE ?) AND id != 1', "%#{query}%", "%#{query}%", "%#{query}%",
|
'(firstname LIKE ? or lastname LIKE ? or email LIKE ?) AND id != 1', "%#{query}%", "%#{query}%", "%#{query}%",
|
||||||
).order('firstname').limit(limit)
|
).order('firstname').limit(limit)
|
||||||
end
|
end
|
||||||
return users
|
users
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -712,7 +712,7 @@ class TestCase < Test::Unit::TestCase
|
||||||
file = File.join(Dir.pwd, filename)
|
file = File.join(Dir.pwd, filename)
|
||||||
#file = 'some test lalal'
|
#file = 'some test lalal'
|
||||||
|
|
||||||
element = instance.find_elements( { css: params[:css] } )[0].send_keys file
|
instance.find_elements( { css: params[:css] } )[0].send_keys file
|
||||||
#instance.find_elements( { :css => params[:css] } )[0]
|
#instance.find_elements( { :css => params[:css] } )[0]
|
||||||
#element
|
#element
|
||||||
#@driver.find_element(id: 'file-submit').click
|
#@driver.find_element(id: 'file-submit').click
|
||||||
|
|
Loading…
Reference in a new issue