Browse Source

Corrected with rubocop cop 'Style/RedundantReturn'.

Thorsten Eckel 10 years ago
parent
commit
69a16ee2c5

+ 1 - 1
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)

+ 3 - 3
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

+ 6 - 6
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

+ 3 - 3
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

+ 1 - 1
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
     }

+ 1 - 1
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,
     }

+ 2 - 2
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

+ 3 - 3
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

+ 7 - 7
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

+ 1 - 1
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

Some files were not shown because too many files changed in this diff