From 158bf737aed8746c2391aadd2da013b23b7b1a47 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Mon, 27 Apr 2015 17:21:17 +0200 Subject: [PATCH] Applied rubocop Style/IndentHash. --- app/controllers/import_otrs_controller.rb | 2 +- app/models/package.rb | 4 +-- lib/sessions.rb | 11 ++++--- lib/sessions/backend/activity_stream.rb | 4 +-- lib/sessions/backend/collections/base.rb | 8 ++--- lib/sessions/backend/rss.rb | 4 +-- lib/sessions/backend/ticket_create.rb | 4 +-- lib/sessions/backend/ticket_overview_index.rb | 4 +-- lib/sessions/backend/ticket_overview_list.rb | 8 ++--- test/unit/activity_stream_test.rb | 6 ++-- test/unit/history_test.rb | 4 +-- test/unit/online_notifiaction_test.rb | 32 +++++++++---------- 12 files changed, 47 insertions(+), 44 deletions(-) diff --git a/app/controllers/import_otrs_controller.rb b/app/controllers/import_otrs_controller.rb index a694c86c7..0e0d49091 100644 --- a/app/controllers/import_otrs_controller.rb +++ b/app/controllers/import_otrs_controller.rb @@ -64,7 +64,7 @@ class ImportOtrsController < ApplicationController # return result render json: { - result: 'invalid', + result: 'invalid', message_human: message_human, } end diff --git a/app/models/package.rb b/app/models/package.rb index 9c4b22dfd..f355adb63 100644 --- a/app/models/package.rb +++ b/app/models/package.rb @@ -207,11 +207,11 @@ class Package < ApplicationModel end # uninstall files of old package - self.uninstall({ + self.uninstall( name: package_db.name, version: package_db.version, migration_not_down: true, - }) + ) end # store package diff --git a/lib/sessions.rb b/lib/sessions.rb index 3d52bf09e..5cdd478a0 100644 --- a/lib/sessions.rb +++ b/lib/sessions.rb @@ -42,10 +42,13 @@ returns # send update to browser if session && session['id'] - self.send( client_id, { - event: 'ws:login', - data: { success: true }, - }) + self.send( + client_id, + { + event: 'ws:login', + data: { success: true }, + } + ) end end diff --git a/lib/sessions/backend/activity_stream.rb b/lib/sessions/backend/activity_stream.rb index 4e872d7d1..888d9d70e 100644 --- a/lib/sessions/backend/activity_stream.rb +++ b/lib/sessions/backend/activity_stream.rb @@ -54,11 +54,11 @@ class Sessions::Backend::ActivityStream end @client.log 'notify', "push activity_stream #{ data.first.class.to_s } for user #{ @user.id }" - @client.send({ + @client.send( event: 'activity_stream_rebuild', collection: 'activity_stream', data: data, - }) + ) end end diff --git a/lib/sessions/backend/collections/base.rb b/lib/sessions/backend/collections/base.rb index 47217b0f3..4bdd65347 100644 --- a/lib/sessions/backend/collections/base.rb +++ b/lib/sessions/backend/collections/base.rb @@ -74,18 +74,18 @@ class Sessions::Backend::Collections::Base } end @client.log 'notify', "push assets for push_collection #{ items.first.class.to_s } for user #{ @user.id }" - @client.send({ + @client.send( data: assets, event: [ 'loadAssets' ], - }) + ) @client.log 'notify', "push push_collection #{ items.first.class.to_s } for user #{ @user.id }" - @client.send({ + @client.send( event: 'resetCollection', data: { items.first.class.to_app_model => all, }, - }) + ) end def self.model_set(model) diff --git a/lib/sessions/backend/rss.rb b/lib/sessions/backend/rss.rb index 5cc0de2fa..95ceaa646 100644 --- a/lib/sessions/backend/rss.rb +++ b/lib/sessions/backend/rss.rb @@ -54,11 +54,11 @@ class Sessions::Backend::Rss end @client.log 'notify', "push rss for user #{@user.id}" - @client.send({ + @client.send( event: 'rss_rebuild', collection: 'dashboard_rss', data: data, - }) + ) end end diff --git a/lib/sessions/backend/ticket_create.rb b/lib/sessions/backend/ticket_create.rb index 039059417..eb0e1c70c 100644 --- a/lib/sessions/backend/ticket_create.rb +++ b/lib/sessions/backend/ticket_create.rb @@ -59,10 +59,10 @@ class Sessions::Backend::TicketCreate end @client.log 'notify', "push ticket_create for user #{ @user.id }" - @client.send({ + @client.send( collection: 'ticket_create_attributes', data: data, - }) + ) end end diff --git a/lib/sessions/backend/ticket_overview_index.rb b/lib/sessions/backend/ticket_overview_index.rb index e87e37f5a..aced54e92 100644 --- a/lib/sessions/backend/ticket_overview_index.rb +++ b/lib/sessions/backend/ticket_overview_index.rb @@ -57,10 +57,10 @@ class Sessions::Backend::TicketOverviewIndex end @client.log 'notify', "push overview_index for user #{ @user.id }" - @client.send({ + @client.send( event: ['ticket_overview_index'], data: data, - }) + ) end end diff --git a/lib/sessions/backend/ticket_overview_list.rb b/lib/sessions/backend/ticket_overview_list.rb index 6a65a954d..57905e119 100644 --- a/lib/sessions/backend/ticket_overview_list.rb +++ b/lib/sessions/backend/ticket_overview_list.rb @@ -106,11 +106,11 @@ class Sessions::Backend::TicketOverviewList @client.log 'notify', "push overview_list for user #{ @user.id }" # send update to browser - @client.send({ + @client.send( data: assets, event: [ 'loadAssets' ] - }) - @client.send({ + ) + @client.send( data: { view: item[:index].link.to_s, overview: overview_data[:overview], @@ -122,7 +122,7 @@ class Sessions::Backend::TicketOverviewList }, }, event: [ 'ticket_overview_rebuild' ], - }) + ) end } return results if !@client diff --git a/test/unit/activity_stream_test.rb b/test/unit/activity_stream_test.rb index 7a88664fb..0f2efd033 100644 --- a/test/unit/activity_stream_test.rb +++ b/test/unit/activity_stream_test.rb @@ -35,7 +35,7 @@ class ActivityStreamTest < ActiveSupport::TestCase created_by_id: current_user.id, }, article: { - updated_by_id: current_user.id, + updated_by_id: current_user.id, created_by_id: current_user.id, type_id: Ticket::Article::Type.lookup( name: 'phone' ).id, sender_id: Ticket::Article::Sender.lookup( name: 'Customer' ).id, @@ -59,10 +59,10 @@ class ActivityStreamTest < ActiveSupport::TestCase }, check: [ { - result: true, + result: true, object: 'Ticket', type: 'updated', - }, + }, { result: true, object: 'Ticket::Article', diff --git a/test/unit/history_test.rb b/test/unit/history_test.rb index 6426c2fc0..a00bbad78 100644 --- a/test/unit/history_test.rb +++ b/test/unit/history_test.rb @@ -21,7 +21,7 @@ class HistoryTest < ActiveSupport::TestCase created_by_id: current_user.id, }, article: { - updated_by_id: current_user.id, + updated_by_id: current_user.id, created_by_id: current_user.id, type_id: Ticket::Article::Type.lookup( name: 'phone' ).id, sender_id: Ticket::Article::Sender.lookup( name: 'Customer' ).id, @@ -88,7 +88,7 @@ class HistoryTest < ActiveSupport::TestCase created_by_id: current_user.id, }, article: { - created_by_id: current_user.id, + created_by_id: current_user.id, updated_by_id: current_user.id, type_id: Ticket::Article::Type.lookup(name: 'phone' ).id, sender_id: Ticket::Article::Sender.lookup(name: 'Customer' ).id, diff --git a/test/unit/online_notifiaction_test.rb b/test/unit/online_notifiaction_test.rb index 7e71fd103..c07863b28 100644 --- a/test/unit/online_notifiaction_test.rb +++ b/test/unit/online_notifiaction_test.rb @@ -72,15 +72,15 @@ class OnlineNotificationTest < ActiveSupport::TestCase }, check: [ { - type: 'create', + type: 'create', object: 'Ticket', created_by_id: agent_user1.id, - }, + }, { - type: 'update', + type: 'update', object: 'Ticket', created_by_id: customer_user.id, - }, + }, ], }, @@ -123,15 +123,15 @@ class OnlineNotificationTest < ActiveSupport::TestCase }, check: [ { - type: 'create', + type: 'create', object: 'Ticket', created_by_id: agent_user1.id, - }, + }, { - type: 'update', + type: 'update', object: 'Ticket', created_by_id: customer_user.id, - }, + }, ], }, @@ -174,15 +174,15 @@ class OnlineNotificationTest < ActiveSupport::TestCase }, check: [ { - type: 'create', + type: 'create', object: 'Ticket', created_by_id: agent_user1.id, - }, + }, { - type: 'update', + type: 'update', object: 'Ticket', created_by_id: customer_user.id, - }, + }, ], }, @@ -225,15 +225,15 @@ class OnlineNotificationTest < ActiveSupport::TestCase }, check: [ { - type: 'create', + type: 'create', object: 'Ticket', created_by_id: agent_user1.id, - }, + }, { - type: 'update', + type: 'update', object: 'Ticket', created_by_id: customer_user.id, - }, + }, ], }, ]