Some new rubocop checks.

This commit is contained in:
Martin Edenhofer 2015-04-27 23:44:41 +02:00
parent a2d49cefc5
commit bd29c71687
16 changed files with 482 additions and 460 deletions

View file

@ -1,6 +1,7 @@
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/ # Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
module ApplicationModel::ActivityStreamBase class ApplicationModel
module ActivityStreamBase
=begin =begin
@ -41,5 +42,5 @@ returns
created_by_id: user_id, created_by_id: user_id,
) )
end end
end
end end

View file

@ -1,6 +1,7 @@
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/ # Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
module ApplicationModel::Assets class ApplicationModel
module Assets
=begin =begin
@ -39,5 +40,5 @@ returns
} }
data data
end end
end
end end

View file

@ -1,5 +1,6 @@
# perform background job # perform background job
class ApplicationModel::BackgroundJobSearchIndex class ApplicationModel
class BackgroundJobSearchIndex
def initialize(object, o_id) def initialize(object, o_id)
@object = object @object = object
@o_id = o_id @o_id = o_id
@ -9,3 +10,4 @@ class ApplicationModel::BackgroundJobSearchIndex
Object.const_get(@object).find(@o_id).search_index_update_backend Object.const_get(@object).find(@o_id).search_index_update_backend
end end
end end
end

View file

@ -1,6 +1,7 @@
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/ # Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
module ApplicationModel::HistoryLogBase class ApplicationModel
module HistoryLogBase
=begin =begin
@ -91,10 +92,10 @@ returns
history[:assets] = record.assets( history[:assets] ) history[:assets] = record.assets( history[:assets] )
end end
} }
return { {
history: history[:list], history: history[:list],
assets: history[:assets], assets: history[:assets],
} }
end end
end
end end

View file

@ -1,6 +1,7 @@
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/ # Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
module ApplicationModel::SearchIndexBase class ApplicationModel
module SearchIndexBase
=begin =begin
@ -141,5 +142,5 @@ returns
} }
attributes_new.merge(attributes) attributes_new.merge(attributes)
end end
end
end end

View file

@ -1,6 +1,7 @@
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/ # Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
module History::Assets class History
module Assets
=begin =begin
@ -29,5 +30,5 @@ returns
data data
end end
end
end end

View file

@ -1,6 +1,7 @@
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/ # Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
module Organization::Assets class Organization
module Assets
=begin =begin
@ -48,5 +49,5 @@ returns
} }
data data
end end
end
end end

View file

@ -1,6 +1,7 @@
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/ # Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
module Organization::Permission class Organization
module Permission
=begin =begin
@ -32,7 +33,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 end

View file

@ -1,6 +1,7 @@
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/ # Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
module Organization::Search class Organization
module Search
=begin =begin
@ -67,3 +68,4 @@ returns
organizations organizations
end end
end end
end

View file

@ -1,6 +1,7 @@
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/ # Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
module Organization::SearchIndex class Organization
module SearchIndex
=begin =begin
@ -56,5 +57,5 @@ returns
attributes_new.merge(attributes) attributes_new.merge(attributes)
end end
end
end end

View file

@ -1,6 +1,7 @@
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/ # Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
class Store::File < ApplicationModel class Store
class File < ApplicationModel
include ApplicationLib include ApplicationLib
after_destroy :destroy_provider after_destroy :destroy_provider
@ -88,3 +89,4 @@ class Store::File < ApplicationModel
adapter.delete( self.sha ) adapter.delete( self.sha )
end end
end end
end

View file

@ -1,5 +1,7 @@
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/ # Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
class Store::Object < ApplicationModel class Store
class Object < ApplicationModel
validates :name, presence: true validates :name, presence: true
end end
end

View file

@ -1,6 +1,8 @@
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/ # Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
class Store::Provider::DB < ApplicationModel class Store
class Provider
class DB < ApplicationModel
self.table_name = 'store_provider_dbs' self.table_name = 'store_provider_dbs'
def self.add(data, sha) def self.add(data, sha)
@ -21,5 +23,6 @@ class Store::Provider::DB < ApplicationModel
Store::Provider::DB.where( sha: sha ).destroy_all Store::Provider::DB.where( sha: sha ).destroy_all
true true
end end
end
end
end end

View file

@ -1,6 +1,8 @@
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/ # Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
class Store::Provider::File class Store
class Provider
class File
def self.add(data, sha) def self.add(data, sha)
write_to_fs(data, sha) write_to_fs(data, sha)
@ -80,5 +82,6 @@ class Store::Provider::File
true true
end end
end
end
end end

View file

@ -319,7 +319,7 @@ returns
return check_time if !escalation_time return check_time if !escalation_time
return escalation_time if !check_time return escalation_time if !check_time
return check_time if escalation_time > check_time return check_time if escalation_time > check_time
return escalation_time escalation_time
end end
end end
end end

View file

@ -73,7 +73,7 @@ returns
assets = record.assets(assets) assets = record.assets(assets)
end end
} }
return { {
history: list, history: list,
assets: assets, assets: assets,
} }