diff --git a/app/models/channel/email_parser.rb b/app/models/channel/email_parser.rb index 526f97e37..1d3862649 100644 --- a/app/models/channel/email_parser.rb +++ b/app/models/channel/email_parser.rb @@ -491,7 +491,7 @@ class Channel::EmailParser } # return new objects - return ticket, article, user + [ticket, article, user] end def user_create(data) diff --git a/app/models/channel/twitter2.rb b/app/models/channel/twitter2.rb index 4720ca5fc..5724aa1c1 100644 --- a/app/models/channel/twitter2.rb +++ b/app/models/channel/twitter2.rb @@ -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 diff --git a/app/models/history.rb b/app/models/history.rb index 1b24f60f2..5c97b1a37 100644 --- a/app/models/history.rb +++ b/app/models/history.rb @@ -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 diff --git a/app/models/link.rb b/app/models/link.rb index 039b888e0..554707e30 100644 --- a/app/models/link.rb +++ b/app/models/link.rb @@ -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 diff --git a/app/models/online_notification.rb b/app/models/online_notification.rb index 954aa45ca..637b88769 100644 --- a/app/models/online_notification.rb +++ b/app/models/online_notification.rb @@ -171,7 +171,7 @@ returns: notifications = OnlineNotification.list(user, limit) assets = ApplicationModel.assets_of_object_list(notifications) - return { + { stream: notifications, assets: assets } diff --git a/app/models/recent_view.rb b/app/models/recent_view.rb index ea64c0f9e..d5e7e2239 100644 --- a/app/models/recent_view.rb +++ b/app/models/recent_view.rb @@ -67,7 +67,7 @@ class RecentView < ApplicationModel # get related object assets = ApplicationModel.assets_of_object_list(recent_viewed) - return { + { stream: recent_viewed, assets: assets, } diff --git a/app/models/setting.rb b/app/models/setting.rb index 9a2effc26..9439d3a77 100644 --- a/app/models/setting.rb +++ b/app/models/setting.rb @@ -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 diff --git a/app/models/store.rb b/app/models/store.rb index 4d8540bfb..58904adb6 100644 --- a/app/models/store.rb +++ b/app/models/store.rb @@ -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 diff --git a/app/models/tag.rb b/app/models/tag.rb index ba3002516..9f2b30cd7 100644 --- a/app/models/tag.rb +++ b/app/models/tag.rb @@ -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 diff --git a/app/models/ticket/subject.rb b/app/models/ticket/subject.rb index 054abd4cb..7a7f61163 100644 --- a/app/models/ticket/subject.rb +++ b/app/models/ticket/subject.rb @@ -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 diff --git a/app/models/token.rb b/app/models/token.rb index b48d34aa5..ff615d0aa 100644 --- a/app/models/token.rb +++ b/app/models/token.rb @@ -22,7 +22,7 @@ class Token < ActiveRecord::Base end # return token if valid - return token.user + token.user end private diff --git a/app/models/translation.rb b/app/models/translation.rb index 715df596b..d748bbc80 100644 --- a/app/models/translation.rb +++ b/app/models/translation.rb @@ -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 diff --git a/app/models/user.rb b/app/models/user.rb index 6256eae8f..18f0eae30 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -159,7 +159,7 @@ returns # get related objects assets = ApplicationModel.assets_of_object_list(activity_stream) - return { + { activity_stream: activity_stream, assets: assets, } diff --git a/lib/auth.rb b/lib/auth.rb index abb70af83..d77682a5d 100644 --- a/lib/auth.rb +++ b/lib/auth.rb @@ -54,7 +54,5 @@ returns return user_auth end } - return - - end + end end diff --git a/lib/auth/developer.rb b/lib/auth/developer.rb index ce006d19d..fc28219ee 100644 --- a/lib/auth/developer.rb +++ b/lib/auth/developer.rb @@ -8,6 +8,6 @@ module Auth::Developer return user if password == 'test' end - return false + false end end diff --git a/lib/auth/internal.rb b/lib/auth/internal.rb index 2ccbd30d5..0c367442d 100644 --- a/lib/auth/internal.rb +++ b/lib/auth/internal.rb @@ -15,6 +15,6 @@ module Auth::Internal # plain auth check return user if user.password == password - return false + false end end diff --git a/lib/auth/ldap.rb b/lib/auth/ldap.rb index b3db2c056..3e5ed005b 100644 --- a/lib/auth/ldap.rb +++ b/lib/auth/ldap.rb @@ -119,6 +119,6 @@ module Auth::Ldap # take session down # - not needed, done by Net::LDAP - - return user + user end end diff --git a/lib/auth/otrs.rb b/lib/auth/otrs.rb index 052d9acf6..3dab3b7b1 100644 --- a/lib/auth/otrs.rb +++ b/lib/auth/otrs.rb @@ -23,6 +23,6 @@ module Auth::Otrs # sync / check permissions Import::OTRS.permission_sync( user, result, config ) - return user + user end end diff --git a/lib/geo_location/gmaps.rb b/lib/geo_location/gmaps.rb index 7265ed49b..a96b32a8e 100644 --- a/lib/geo_location/gmaps.rb +++ b/lib/geo_location/gmaps.rb @@ -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 diff --git a/lib/import/otrs.rb b/lib/import/otrs.rb index 3711a96ab..e0cf187dc 100644 --- a/lib/import/otrs.rb +++ b/lib/import/otrs.rb @@ -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,8 +167,7 @@ module Import::OTRS threads[thread].join } - return - end + end def self.diff_worker return if !Setting.get('import_mode') @@ -198,7 +197,6 @@ module Import::OTRS self.ticket_diff() - return end def self.ticket_diff() diff --git a/lib/import/otrs2.rb b/lib/import/otrs2.rb index d6fb034b3..6731e255c 100644 --- a/lib/import/otrs2.rb +++ b/lib/import/otrs2.rb @@ -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 diff --git a/lib/rss.rb b/lib/rss.rb index 5a2d0524c..aa13e8f2e 100644 --- a/lib/rss.rb +++ b/lib/rss.rb @@ -34,6 +34,6 @@ module Rss return end - return items + items end end diff --git a/lib/session_helper.rb b/lib/session_helper.rb index 4add9ed6b..ae97d7210 100644 --- a/lib/session_helper.rb +++ b/lib/session_helper.rb @@ -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) diff --git a/lib/sessions.rb b/lib/sessions.rb index 5cdd478a0..9d1bf2ab8 100644 --- a/lib/sessions.rb +++ b/lib/sessions.rb @@ -468,7 +468,7 @@ returns to_delete.each {|file| File.delete(file) } - return data + data end def self.jobs diff --git a/lib/sso.rb b/lib/sso.rb index f85add86f..a7ae93e2e 100644 --- a/lib/sso.rb +++ b/lib/sso.rb @@ -65,7 +65,5 @@ returns return user_auth end } - return - end end diff --git a/lib/time_calculation.rb b/lib/time_calculation.rb index 48e02ef86..46f031cd0 100644 --- a/lib/time_calculation.rb +++ b/lib/time_calculation.rb @@ -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