Applied rubocop Style/CommentIndentation.
This commit is contained in:
parent
dd9a9ad19f
commit
43a924f554
19 changed files with 36 additions and 51 deletions
|
@ -519,8 +519,7 @@ end
|
||||||
def self.notify_clients_support
|
def self.notify_clients_support
|
||||||
after_create :notify_clients_after_create
|
after_create :notify_clients_after_create
|
||||||
after_update :notify_clients_after_update
|
after_update :notify_clients_after_update
|
||||||
# after_touch :notify_clients_after_touch
|
after_touch :notify_clients_after_touch
|
||||||
after_touch :notify_clients_after_update
|
|
||||||
after_destroy :notify_clients_after_destroy
|
after_destroy :notify_clients_after_destroy
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -117,7 +117,6 @@ add a new attribute entry for an object
|
||||||
name: data[:name],
|
name: data[:name],
|
||||||
)
|
)
|
||||||
if result
|
if result
|
||||||
# raise "ERROR: attribute #{data[:name]} for #{data[:object]} already exists"
|
|
||||||
return result.update_attributes(data)
|
return result.update_attributes(data)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ class Observer::Ticket::Article::CommunicateTwitter < ActiveRecord::Observer
|
||||||
body: record.body,
|
body: record.body,
|
||||||
in_reply_to: record.in_reply_to
|
in_reply_to: record.in_reply_to
|
||||||
},
|
},
|
||||||
# Rails.application.config.channel_twitter
|
#Rails.application.config.channel_twitter
|
||||||
)
|
)
|
||||||
record.message_id = message.id
|
record.message_id = message.id
|
||||||
record.save
|
record.save
|
||||||
|
|
|
@ -261,8 +261,8 @@ returns
|
||||||
if counted
|
if counted
|
||||||
# puts "Diff count #{history_item['value_from']} -> #{history_item['value_to']} / #{last_state_change} -> #{history_item['created_at']}"
|
# puts "Diff count #{history_item['value_from']} -> #{history_item['value_to']} / #{last_state_change} -> #{history_item['created_at']}"
|
||||||
total_time_without_pending = total_time_without_pending + diff
|
total_time_without_pending = total_time_without_pending + diff
|
||||||
# else
|
# else
|
||||||
# puts "Diff not count #{history_item['value_from']} -> #{history_item['value_to']} / #{last_state_change} -> #{history_item['created_at']}"
|
# puts "Diff not count #{history_item['value_from']} -> #{history_item['value_to']} / #{last_state_change} -> #{history_item['created_at']}"
|
||||||
end
|
end
|
||||||
total_time = total_time + diff
|
total_time = total_time + diff
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,7 @@ class CreateBase < ActiveRecord::Migration
|
||||||
end
|
end
|
||||||
add_index :users, [:login], unique: true
|
add_index :users, [:login], unique: true
|
||||||
add_index :users, [:email]
|
add_index :users, [:email]
|
||||||
# add_index :users, [:email], :unique => true
|
#add_index :users, [:email], unique: => true
|
||||||
add_index :users, [:image]
|
add_index :users, [:image]
|
||||||
add_index :users, [:department]
|
add_index :users, [:department]
|
||||||
add_index :users, [:phone]
|
add_index :users, [:phone]
|
||||||
|
@ -74,7 +74,7 @@ class CreateBase < ActiveRecord::Migration
|
||||||
create_table :groups do |t|
|
create_table :groups do |t|
|
||||||
t.references :signature, null: true
|
t.references :signature, null: true
|
||||||
t.references :email_address, null: true
|
t.references :email_address, null: true
|
||||||
t.column :name, :string, limit: 100, null: false
|
t.column :name, :string, limit: 160, null: false
|
||||||
t.column :assignment_timeout, :integer, null: true
|
t.column :assignment_timeout, :integer, null: true
|
||||||
t.column :follow_up_possible, :string, limit: 100, null: false, default: 'yes'
|
t.column :follow_up_possible, :string, limit: 100, null: false, default: 'yes'
|
||||||
t.column :follow_up_assignment, :boolean, null: false, default: true
|
t.column :follow_up_assignment, :boolean, null: false, default: true
|
||||||
|
|
|
@ -141,7 +141,7 @@ class CreateTicket < ActiveRecord::Migration
|
||||||
t.column :to, :string, limit: 3000, null: true
|
t.column :to, :string, limit: 3000, null: true
|
||||||
t.column :cc, :string, limit: 3000, null: true
|
t.column :cc, :string, limit: 3000, null: true
|
||||||
t.column :subject, :string, limit: 3000, null: true
|
t.column :subject, :string, limit: 3000, null: true
|
||||||
# t.column :reply_to, :string, :limit => 3000, :null => true
|
# t.column :reply_to, :string, :limit => 3000, :null => true
|
||||||
t.column :message_id, :string, limit: 3000, null: true
|
t.column :message_id, :string, limit: 3000, null: true
|
||||||
t.column :message_id_md5, :string, limit: 32, null: true
|
t.column :message_id_md5, :string, limit: 32, null: true
|
||||||
t.column :in_reply_to, :string, limit: 3000, null: true
|
t.column :in_reply_to, :string, limit: 3000, null: true
|
||||||
|
|
|
@ -12,9 +12,6 @@ class PostmasterFilterCreate < ActiveRecord::Migration
|
||||||
t.timestamps
|
t.timestamps
|
||||||
end
|
end
|
||||||
add_index :postmaster_filters, [:channel]
|
add_index :postmaster_filters, [:channel]
|
||||||
|
|
||||||
# add_column :groups, :email_address_id, :integer, :null => true
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def down
|
def down
|
||||||
|
|
|
@ -497,7 +497,6 @@ class UpdateObjectManager2 < ActiveRecord::Migration
|
||||||
maxlength: 250,
|
maxlength: 250,
|
||||||
null: true,
|
null: true,
|
||||||
note: 'Notes are visible to agents only, never to customers.',
|
note: 'Notes are visible to agents only, never to customers.',
|
||||||
# :item_class => 'formGroup--halfSize',
|
|
||||||
},
|
},
|
||||||
editable: false,
|
editable: false,
|
||||||
active: true,
|
active: true,
|
||||||
|
|
|
@ -42,12 +42,12 @@ returns
|
||||||
# load adapter
|
# load adapter
|
||||||
|
|
||||||
# will only work on ruby 2.0
|
# will only work on ruby 2.0
|
||||||
# Object.const_get(adapter)
|
#Object.const_get(adapter)
|
||||||
|
|
||||||
# will work on ruby 1.9 and 2.0
|
# will work on ruby 1.9 and 2.0
|
||||||
# adapter.split('::').inject(Object) do |mod, class_name|
|
#adapter.split('::').inject(Object) do |mod, class_name|
|
||||||
# mod.const_get(class_name)
|
# mod.const_get(class_name)
|
||||||
# end
|
#end
|
||||||
|
|
||||||
# will work with active_support
|
# will work with active_support
|
||||||
adapter = adapter.constantize
|
adapter = adapter.constantize
|
||||||
|
|
|
@ -35,6 +35,6 @@ module Encode
|
||||||
Rails.logger.error 'ERROR: ' + e.inspect
|
Rails.logger.error 'ERROR: ' + e.inspect
|
||||||
string
|
string
|
||||||
end
|
end
|
||||||
# Iconv.conv( 'UTF8', charset, string )
|
#Iconv.conv( 'UTF8', charset, string )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -481,7 +481,6 @@ module Import::OTRS
|
||||||
end
|
end
|
||||||
|
|
||||||
def self._ticket_result(result, locks, _thread = '-')
|
def self._ticket_result(result, locks, _thread = '-')
|
||||||
# puts result.inspect
|
|
||||||
map = {
|
map = {
|
||||||
Ticket: {
|
Ticket: {
|
||||||
Changed: :updated_at,
|
Changed: :updated_at,
|
||||||
|
@ -496,13 +495,13 @@ module Import::OTRS
|
||||||
Title: :title,
|
Title: :title,
|
||||||
TicketID: :id,
|
TicketID: :id,
|
||||||
FirstResponse: :first_response,
|
FirstResponse: :first_response,
|
||||||
# :FirstResponseTimeDestinationDate => :first_response_escal_date,
|
#FirstResponseTimeDestinationDate: :first_response_escal_date,
|
||||||
# :FirstResponseInMin => :first_response_in_min,
|
#FirstResponseInMin: :first_response_in_min,
|
||||||
# :FirstResponseDiffInMin => :first_response_diff_in_min,
|
#FirstResponseDiffInMin: :first_response_diff_in_min,
|
||||||
Closed: :close_time,
|
Closed: :close_time,
|
||||||
# :SoltutionTimeDestinationDate => :close_time_escal_date,
|
#SoltutionTimeDestinationDate: :close_time_escal_date,
|
||||||
# :CloseTimeInMin => :close_time_in_min,
|
#CloseTimeInMin: :close_time_in_min,
|
||||||
# :CloseTimeDiffInMin => :close_time_diff_in_min,
|
#CloseTimeDiffInMin: :close_time_diff_in_min,
|
||||||
},
|
},
|
||||||
Article: {
|
Article: {
|
||||||
SenderType: :sender,
|
SenderType: :sender,
|
||||||
|
@ -516,7 +515,7 @@ module Import::OTRS
|
||||||
Subject: :subject,
|
Subject: :subject,
|
||||||
InReplyTo: :in_reply_to,
|
InReplyTo: :in_reply_to,
|
||||||
MessageID: :message_id,
|
MessageID: :message_id,
|
||||||
# :ReplyTo => :reply_to,
|
#ReplyTo: :reply_to,
|
||||||
References: :references,
|
References: :references,
|
||||||
Changed: :updated_at,
|
Changed: :updated_at,
|
||||||
Created: :created_at,
|
Created: :created_at,
|
||||||
|
@ -988,8 +987,8 @@ module Import::OTRS
|
||||||
# lookup by roles
|
# lookup by roles
|
||||||
|
|
||||||
# roles of user
|
# roles of user
|
||||||
# groups of roles
|
# groups of roles
|
||||||
# queues of group
|
# queues of group
|
||||||
|
|
||||||
queue_ids
|
queue_ids
|
||||||
end
|
end
|
||||||
|
|
|
@ -3,12 +3,12 @@ module NotificationFactory
|
||||||
=begin
|
=begin
|
||||||
|
|
||||||
result_string = NotificationFactory.build(
|
result_string = NotificationFactory.build(
|
||||||
:string => 'Hi #{recipient.firstname},',
|
string: 'Hi #{recipient.firstname},',
|
||||||
:objects => {
|
objects: {
|
||||||
:ticket => ticket,
|
ticket : ticket,
|
||||||
:recipient => User.find(2),
|
recipient: User.find(2),
|
||||||
},
|
},
|
||||||
:locale => 'en',
|
locale: 'en',
|
||||||
)
|
)
|
||||||
|
|
||||||
=end
|
=end
|
||||||
|
@ -94,10 +94,10 @@ module NotificationFactory
|
||||||
=begin
|
=begin
|
||||||
|
|
||||||
success = NotificationFactory.send(
|
success = NotificationFactory.send(
|
||||||
:recipient => User.find(123),
|
recipient: User.find(123),
|
||||||
:subject => 'sime subject',
|
subject: 'sime subject',
|
||||||
:body => 'some body',
|
body: 'some body',
|
||||||
:content_type => '', # optional, e. g. 'text/html'
|
content_type: '', # optional, e. g. 'text/html'
|
||||||
)
|
)
|
||||||
|
|
||||||
=end
|
=end
|
||||||
|
@ -113,7 +113,7 @@ module NotificationFactory
|
||||||
|
|
||||||
Channel::EmailSend.send(
|
Channel::EmailSend.send(
|
||||||
{
|
{
|
||||||
# :in_reply_to => self.in_reply_to,
|
# in_reply_to: in_reply_to,
|
||||||
from: sender,
|
from: sender,
|
||||||
to: data[:recipient][:email],
|
to: data[:recipient][:email],
|
||||||
subject: data[:subject],
|
subject: data[:subject],
|
||||||
|
|
|
@ -577,8 +577,6 @@ returns
|
||||||
Rails.logger.error e.backtrace.join("\n ")
|
Rails.logger.error e.backtrace.join("\n ")
|
||||||
sleep 10
|
sleep 10
|
||||||
begin
|
begin
|
||||||
# ActiveRecord::Base.remove_connection
|
|
||||||
# ActiveRecord::Base.connection_pool.reap
|
|
||||||
ActiveRecord::Base.connection_pool.release_connection
|
ActiveRecord::Base.connection_pool.release_connection
|
||||||
rescue => e
|
rescue => e
|
||||||
Rails.logger.error "Can't reconnect to database #{ e.inspect }"
|
Rails.logger.error "Can't reconnect to database #{ e.inspect }"
|
||||||
|
|
|
@ -10,7 +10,6 @@ module Sessions::CacheIn
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.set( key, value, params = {} )
|
def self.set( key, value, params = {} )
|
||||||
# puts 'CacheIn.set:' + key + '-' + value.inspect
|
|
||||||
if params[:expires_in]
|
if params[:expires_in]
|
||||||
@@expires_in[key] = Time.now + params[:expires_in]
|
@@expires_in[key] = Time.now + params[:expires_in]
|
||||||
@@expires_in_ttl[key] = params[:expires_in]
|
@@expires_in_ttl[key] = params[:expires_in]
|
||||||
|
@ -46,7 +45,6 @@ module Sessions::CacheIn
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.get( key, params = {} )
|
def self.get( key, params = {} )
|
||||||
# puts 'CacheIn.get:' + key + '-' + @@data[ key ].inspect
|
|
||||||
return if expired( key, params )
|
return if expired( key, params )
|
||||||
@@data[ key ]
|
@@data[ key ]
|
||||||
end
|
end
|
||||||
|
|
|
@ -268,7 +268,7 @@ put working hours matrix and timezone in function, returns UTC working hours mat
|
||||||
month = start_time.month
|
month = start_time.month
|
||||||
year = start_time.year
|
year = start_time.year
|
||||||
hour = start_time.hour
|
hour = start_time.hour
|
||||||
#puts "start outer loop #{start_time}-#{week_day}-#{year}-#{month}-#{day}-#{hour}|c#{count}"
|
#puts "start outer loop #{start_time}-#{week_day}-#{year}-#{month}-#{day}-#{hour}|c#{count}"
|
||||||
|
|
||||||
# check if it's vacation day
|
# check if it's vacation day
|
||||||
if config
|
if config
|
||||||
|
|
3
vendor/lib/facebook_database.rb
vendored
3
vendor/lib/facebook_database.rb
vendored
|
@ -4,8 +4,7 @@ class FacebookDatabase < OmniAuth::Strategies::Facebook
|
||||||
def initialize(app, *args, &block)
|
def initialize(app, *args, &block)
|
||||||
|
|
||||||
# database lookup
|
# database lookup
|
||||||
# puts 'FacebookDatabase -> initialize'
|
config = Setting.get('auth_facebook_credentials') || {}
|
||||||
config = Setting.get('auth_facebook_credentials') || {}
|
|
||||||
args[0] = config['app_id']
|
args[0] = config['app_id']
|
||||||
args[1] = config['app_secret']
|
args[1] = config['app_secret']
|
||||||
super
|
super
|
||||||
|
|
3
vendor/lib/google_oauth2_database.rb
vendored
3
vendor/lib/google_oauth2_database.rb
vendored
|
@ -4,8 +4,7 @@ class GoogleOauth2Database < OmniAuth::Strategies::GoogleOauth2
|
||||||
def initialize(app, *args, &block)
|
def initialize(app, *args, &block)
|
||||||
|
|
||||||
# database lookup
|
# database lookup
|
||||||
# puts 'GoogleOauth2Database -> initialize'
|
config = Setting.get('auth_google_oauth2_credentials') || {}
|
||||||
config = Setting.get('auth_google_oauth2_credentials') || {}
|
|
||||||
args[0] = config['client_id']
|
args[0] = config['client_id']
|
||||||
args[1] = config['client_secret']
|
args[1] = config['client_secret']
|
||||||
super
|
super
|
||||||
|
|
3
vendor/lib/linked_in_database.rb
vendored
3
vendor/lib/linked_in_database.rb
vendored
|
@ -4,8 +4,7 @@ class LinkedInDatabase < OmniAuth::Strategies::LinkedIn
|
||||||
def initialize(app, *args, &block)
|
def initialize(app, *args, &block)
|
||||||
|
|
||||||
# database lookup
|
# database lookup
|
||||||
# puts 'LinkedInDatabase -> initialize'
|
config = Setting.get('auth_linkedin_credentials') || {}
|
||||||
config = Setting.get('auth_linkedin_credentials') || {}
|
|
||||||
args[0] = config['app_id']
|
args[0] = config['app_id']
|
||||||
args[1] = config['app_secret']
|
args[1] = config['app_secret']
|
||||||
super
|
super
|
||||||
|
|
3
vendor/lib/twitter_database.rb
vendored
3
vendor/lib/twitter_database.rb
vendored
|
@ -4,8 +4,7 @@ class TwitterDatabase < OmniAuth::Strategies::Twitter
|
||||||
def initialize(app, *args, &block)
|
def initialize(app, *args, &block)
|
||||||
|
|
||||||
# database lookup
|
# database lookup
|
||||||
# puts 'TwitterDatabase -> initialize'
|
config = Setting.get('auth_twitter_credentials') || {}
|
||||||
config = Setting.get('auth_twitter_credentials') || {}
|
|
||||||
args[0] = config['key']
|
args[0] = config['key']
|
||||||
args[1] = config['secret']
|
args[1] = config['secret']
|
||||||
super
|
super
|
||||||
|
|
Loading…
Reference in a new issue