Some new rubocop checks.
This commit is contained in:
parent
a2d49cefc5
commit
bd29c71687
16 changed files with 482 additions and 460 deletions
|
@ -1,6 +1,7 @@
|
|||
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||
|
||||
module ApplicationModel::ActivityStreamBase
|
||||
class ApplicationModel
|
||||
module ActivityStreamBase
|
||||
|
||||
=begin
|
||||
|
||||
|
@ -41,5 +42,5 @@ returns
|
|||
created_by_id: user_id,
|
||||
)
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||
|
||||
module ApplicationModel::Assets
|
||||
class ApplicationModel
|
||||
module Assets
|
||||
|
||||
=begin
|
||||
|
||||
|
@ -39,5 +40,5 @@ returns
|
|||
}
|
||||
data
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
# perform background job
|
||||
class ApplicationModel::BackgroundJobSearchIndex
|
||||
class ApplicationModel
|
||||
class BackgroundJobSearchIndex
|
||||
def initialize(object, o_id)
|
||||
@object = object
|
||||
@o_id = o_id
|
||||
|
@ -8,4 +9,5 @@ class ApplicationModel::BackgroundJobSearchIndex
|
|||
def perform
|
||||
Object.const_get(@object).find(@o_id).search_index_update_backend
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||
|
||||
module ApplicationModel::HistoryLogBase
|
||||
class ApplicationModel
|
||||
module HistoryLogBase
|
||||
|
||||
=begin
|
||||
|
||||
|
@ -91,10 +92,10 @@ returns
|
|||
history[:assets] = record.assets( history[:assets] )
|
||||
end
|
||||
}
|
||||
return {
|
||||
{
|
||||
history: history[:list],
|
||||
assets: history[:assets],
|
||||
}
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||
|
||||
module ApplicationModel::SearchIndexBase
|
||||
class ApplicationModel
|
||||
module SearchIndexBase
|
||||
|
||||
=begin
|
||||
|
||||
|
@ -141,5 +142,5 @@ returns
|
|||
}
|
||||
attributes_new.merge(attributes)
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||
|
||||
module History::Assets
|
||||
class History
|
||||
module Assets
|
||||
|
||||
=begin
|
||||
|
||||
|
@ -29,5 +30,5 @@ returns
|
|||
|
||||
data
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||
|
||||
module Organization::Assets
|
||||
class Organization
|
||||
module Assets
|
||||
|
||||
=begin
|
||||
|
||||
|
@ -48,5 +49,5 @@ returns
|
|||
}
|
||||
data
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||
|
||||
module Organization::Permission
|
||||
class Organization
|
||||
module Permission
|
||||
|
||||
=begin
|
||||
|
||||
|
@ -32,7 +33,7 @@ returns
|
|||
# check agent
|
||||
return true if data[:current_user].is_role(Z_ROLENAME_ADMIN)
|
||||
return true if data[:current_user].is_role('Agent')
|
||||
return false
|
||||
false
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||
|
||||
module Organization::Search
|
||||
class Organization
|
||||
module Search
|
||||
|
||||
=begin
|
||||
|
||||
|
@ -66,4 +67,5 @@ returns
|
|||
end
|
||||
organizations
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||
|
||||
module Organization::SearchIndex
|
||||
class Organization
|
||||
module SearchIndex
|
||||
|
||||
=begin
|
||||
|
||||
|
@ -56,5 +57,5 @@ returns
|
|||
|
||||
attributes_new.merge(attributes)
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||
|
||||
class Store::File < ApplicationModel
|
||||
class Store
|
||||
class File < ApplicationModel
|
||||
include ApplicationLib
|
||||
after_destroy :destroy_provider
|
||||
|
||||
|
@ -87,4 +88,5 @@ class Store::File < ApplicationModel
|
|||
adapter = self.class.load_adapter("Store::Provider::#{ self.provider }")
|
||||
adapter.delete( self.sha )
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||
|
||||
class Store::Object < ApplicationModel
|
||||
class Store
|
||||
class Object < ApplicationModel
|
||||
validates :name, presence: true
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
# 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'
|
||||
|
||||
def self.add(data, sha)
|
||||
|
@ -21,5 +23,6 @@ class Store::Provider::DB < ApplicationModel
|
|||
Store::Provider::DB.where( sha: sha ).destroy_all
|
||||
true
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
# 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)
|
||||
write_to_fs(data, sha)
|
||||
|
@ -80,5 +82,6 @@ class Store::Provider::File
|
|||
|
||||
true
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -319,7 +319,7 @@ returns
|
|||
return check_time if !escalation_time
|
||||
return escalation_time if !check_time
|
||||
return check_time if escalation_time > check_time
|
||||
return escalation_time
|
||||
escalation_time
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -73,7 +73,7 @@ returns
|
|||
assets = record.assets(assets)
|
||||
end
|
||||
}
|
||||
return {
|
||||
{
|
||||
history: list,
|
||||
assets: assets,
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue