Corrected with rubocop cop 'Style/RedundantReturn'.

This commit is contained in:
Thorsten Eckel 2015-04-30 19:20:27 +02:00
parent 19feb32c7b
commit 69a16ee2c5
26 changed files with 51 additions and 58 deletions

View file

@ -491,7 +491,7 @@ class Channel::EmailParser
}
# return new objects
return ticket, article, user
[ticket, article, user]
end
def user_create(data)

View file

@ -134,7 +134,7 @@ class Channel::TWITTER2
ticket = fetch_ticket_create(user, tweet, sender, channel, group)
end
article = fetch_article_create(user, ticket, tweet, sender)
return user, ticket, article
[user, ticket, article]
end
def fetch_user_create(tweet, sender)
@ -177,7 +177,7 @@ class Channel::TWITTER2
# set current user
UserInfo.current_user_id = user.id
return user
user
end
def fetch_ticket_create(user, tweet, sender, channel, group)
@ -298,6 +298,6 @@ class Channel::TWITTER2
}
)
# puts message.inspect
return message
message
end
end

View file

@ -223,7 +223,7 @@ returns
# lookup
history_type = History::Type.lookup( id: id )
@@cache_type[ id ] = history_type
return history_type
history_type
end
def self.type_lookup( name )
@ -243,7 +243,7 @@ returns
name: name
)
@@cache_type[ name ] = history_type
return history_type
history_type
end
def self.object_lookup_id( id )
@ -254,7 +254,7 @@ returns
# lookup
history_object = History::Object.lookup( id: id )
@@cache_object[ id ] = history_object
return history_object
history_object
end
def self.object_lookup( name )
@ -274,7 +274,7 @@ returns
name: name
)
@@cache_object[ name ] = history_object
return history_object
history_object
end
def self.attribute_lookup_id( id )
@ -285,7 +285,7 @@ returns
# lookup
history_attribute = History::Attribute.lookup( id: id )
@@cache_attribute[ id ] = history_attribute
return history_attribute
history_attribute
end
def self.attribute_lookup( name )
@ -305,7 +305,7 @@ returns
name: name
)
@@cache_attribute[ name ] = history_attribute
return history_attribute
history_attribute
end
private

View file

@ -49,7 +49,7 @@ class Link < ApplicationModel
items.push link
}
return items
items
end
=begin
@ -159,7 +159,7 @@ class Link < ApplicationModel
name: data[:name]
)
end
return linktype
linktype
end
def self.link_object_get(data)
@ -169,7 +169,7 @@ class Link < ApplicationModel
name: data[:name]
)
end
return linkobject
linkobject
end
end

View file

@ -171,7 +171,7 @@ returns:
notifications = OnlineNotification.list(user, limit)
assets = ApplicationModel.assets_of_object_list(notifications)
return {
{
stream: notifications,
assets: assets
}

View file

@ -67,7 +67,7 @@ class RecentView < ApplicationModel
# get related object
assets = ApplicationModel.assets_of_object_list(recent_viewed)
return {
{
stream: recent_viewed,
assets: assets,
}

View file

@ -32,7 +32,7 @@ class Setting < ApplicationModel
# store for class requests
@@current[:settings_config] = config
return config
config
end
def self.set(name, value)
@ -47,7 +47,7 @@ class Setting < ApplicationModel
def self.get(name)
self.load
return @@current[:settings_config][name]
@@current[:settings_config][name]
end
private

View file

@ -82,7 +82,7 @@ returns
store_object_id = Store::Object.lookup( name: data[:object] )
stores = Store.where( store_object_id: store_object_id, o_id: data[:o_id].to_i ).
order('created_at ASC, id ASC')
return stores
stores
end
=begin
@ -111,7 +111,7 @@ returns
# check backend for references
Store.remove_item( store.id )
end
return true
true
end
=begin
@ -136,7 +136,7 @@ returns
end
store.destroy
return true
true
end
def content

View file

@ -24,7 +24,7 @@ class Tag < ApplicationModel
o_id: data[:o_id],
created_by_id: data[:created_by_id],
)
return true
true
end
def self.tag_remove(data)
@ -46,7 +46,7 @@ class Tag < ApplicationModel
result.each { |item|
item.destroy
}
return true
true
end
def self.tag_list( data )
@ -59,7 +59,7 @@ class Tag < ApplicationModel
tag_search.each {|tag|
tags.push self.tag_item_lookup_id( tag.tag_item_id )
}
return tags
tags
end
private
@ -72,7 +72,7 @@ class Tag < ApplicationModel
# lookup
tag_item = Tag::Item.find(id)
@@cache_item[ id ] = tag_item.name
return tag_item.name
tag_item.name
end
def self.tag_item_lookup( name )
@ -94,7 +94,7 @@ class Tag < ApplicationModel
name: name
)
@@cache_item[ name ] = tag_item.id
return tag_item.id
tag_item.id
end
def self.tag_object_lookup_id( id )
@ -105,7 +105,7 @@ class Tag < ApplicationModel
# lookup
tag_object = Tag::Object.find(id)
@@cache_object[ id ] = tag_object.name
return tag_object.name
tag_object.name
end
def self.tag_object_lookup( name )
@ -125,7 +125,7 @@ class Tag < ApplicationModel
name: name
)
@@cache_object[ name ] = tag_object.id
return tag_object.id
tag_object.id
end
class Object < ActiveRecord::Base

View file

@ -34,7 +34,7 @@ returns
end
# left position
return "[#{ticket_hook}#{ticket_hook_divider}#{self.number}] " + subject
"[#{ticket_hook}#{ticket_hook_divider}#{self.number}] " + subject
end
=begin

View file

@ -22,7 +22,7 @@ class Token < ActiveRecord::Base
end
# return token if valid
return token.user
token.user
end
private

View file

@ -136,7 +136,7 @@ get list of translations
end
end
return {
{
list: list,
}
end
@ -163,7 +163,7 @@ translate strings in ruby context, e. g. for notifications
return record.target if record.source == string
}
return string
string
end
private

View file

@ -159,7 +159,7 @@ returns
# get related objects
assets = ApplicationModel.assets_of_object_list(activity_stream)
return {
{
activity_stream: activity_stream,
assets: assets,
}

View file

@ -54,7 +54,5 @@ returns
return user_auth
end
}
return
end
end

View file

@ -8,6 +8,6 @@ module Auth::Developer
return user if password == 'test'
end
return false
false
end
end

View file

@ -15,6 +15,6 @@ module Auth::Internal
# plain auth check
return user if user.password == password
return false
false
end
end

View file

@ -119,6 +119,6 @@ module Auth::Ldap
# take session down
# - not needed, done by Net::LDAP -
return user
user
end
end

View file

@ -23,6 +23,6 @@ module Auth::Otrs
# sync / check permissions
Import::OTRS.permission_sync( user, result, config )
return user
user
end
end

View file

@ -26,6 +26,6 @@ class GeoLocation::Gmaps
result = JSON.parse( response.body )
address = result['results'].first['address_components'].first['long_name']
return address
address
end
end

View file

@ -15,7 +15,7 @@ module Import::OTRS
puts "ERROR: #{response.error}"
return
end
return response
response
end
def self.post(base, data)
url = Setting.get('import_otrs_endpoint') + '/' + base
@ -34,7 +34,7 @@ module Import::OTRS
puts "ERROR: #{response.error}"
return
end
return response
response
end
def self.json(response)
@ -48,7 +48,7 @@ module Import::OTRS
return if !response.success?
result = json(response)
return result
result
end
def self.session(session_id)
@ -57,7 +57,7 @@ module Import::OTRS
return if !response.success?
result = json(response)
return result
result
end
def self.permission_sync(user, result, config)
@ -167,7 +167,6 @@ module Import::OTRS
threads[thread].join
}
return
end
def self.diff_worker
@ -198,7 +197,6 @@ module Import::OTRS
self.ticket_diff()
return
end
def self.ticket_diff()

View file

@ -143,7 +143,7 @@ module Import::OTRS2
return if !response.success?
result = json(response)
return result
result
end
=begin
@ -165,7 +165,7 @@ module Import::OTRS2
return if !response
return if !response.success?
result = json(response)
return result
result
end
=begin
@ -201,7 +201,7 @@ module Import::OTRS2
=end
def self.connection_test
return self.request_json({})
self.request_json({})
end
=begin
@ -439,7 +439,6 @@ module Import::OTRS2
# get changed tickets
self.ticket_diff
return
end
def self.ticket_diff

View file

@ -34,6 +34,6 @@ module Rss
return
end
return items
items
end
end

View file

@ -13,7 +13,7 @@ module SessionHelper
(default_collection, assets ) = ExtraCollection.session( default_collection, assets, user )
end
return default_collection, assets
[default_collection, assets]
end
def self.models(user = nil)

View file

@ -468,7 +468,7 @@ returns
to_delete.each {|file|
File.delete(file)
}
return data
data
end
def self.jobs

View file

@ -65,7 +65,5 @@ returns
return user_auth
end
}
return
end
end

View file

@ -93,7 +93,7 @@ put working hours matrix and timezone in function, returns UTC working hours mat
}
}
end
return working_hours
working_hours
end
=begin
@ -350,7 +350,7 @@ put working hours matrix and timezone in function, returns UTC working hours mat
start_time = start_time.beginning_of_day + 86_400
end
return start_time
start_time
end
end