diff --git a/.rubocop.yml b/.rubocop.yml index bc92e3f6d..3f5b06089 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -173,10 +173,6 @@ Style/Documentation: Description: 'Document classes and non-namespace modules.' Enabled: false -Rails/ActionFilter: - Description: 'Enforces consistent use of action filter methods.' - Enabled: false - Style/SignalException: Description: 'Checks for proper usage of fail and raise.' StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#fail-method' diff --git a/app/controllers/activity_stream_controller.rb b/app/controllers/activity_stream_controller.rb index c5ef67daa..fa7037be4 100644 --- a/app/controllers/activity_stream_controller.rb +++ b/app/controllers/activity_stream_controller.rb @@ -1,7 +1,7 @@ # Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/ class ActivityStreamController < ApplicationController - before_filter :authentication_check + before_action :authentication_check # GET /api/v1/activity_stream def show diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 1cd46423b..08676a53e 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -14,12 +14,12 @@ class ApplicationController < ActionController::Base :mode_show_rendeder, :model_index_render - skip_before_filter :verify_authenticity_token - before_filter :set_user, :session_update - before_filter :cors_preflight_check + skip_before_action :verify_authenticity_token + before_action :set_user, :session_update + before_action :cors_preflight_check - after_filter :set_access_control_headers - after_filter :trigger_events + after_action :set_access_control_headers + after_action :trigger_events # For all responses in this controller, return the CORS access control headers. def set_access_control_headers diff --git a/app/controllers/channels_controller.rb b/app/controllers/channels_controller.rb index 50b4e4537..154058096 100644 --- a/app/controllers/channels_controller.rb +++ b/app/controllers/channels_controller.rb @@ -1,7 +1,7 @@ # Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/ class ChannelsController < ApplicationController - before_filter :authentication_check + before_action :authentication_check =begin diff --git a/app/controllers/email_addresses_controller.rb b/app/controllers/email_addresses_controller.rb index 91abc1fdd..14ea8b647 100644 --- a/app/controllers/email_addresses_controller.rb +++ b/app/controllers/email_addresses_controller.rb @@ -1,7 +1,7 @@ # Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/ class EmailAddressesController < ApplicationController - before_filter :authentication_check + before_action :authentication_check =begin diff --git a/app/controllers/groups_controller.rb b/app/controllers/groups_controller.rb index 8d449a8e3..d3311c069 100644 --- a/app/controllers/groups_controller.rb +++ b/app/controllers/groups_controller.rb @@ -1,7 +1,7 @@ # Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/ class GroupsController < ApplicationController - before_filter :authentication_check + before_action :authentication_check =begin diff --git a/app/controllers/ical_tickets_controller.rb b/app/controllers/ical_tickets_controller.rb index ce4caa5a2..c4c1f9bd5 100644 --- a/app/controllers/ical_tickets_controller.rb +++ b/app/controllers/ical_tickets_controller.rb @@ -3,7 +3,7 @@ require 'icalendar' class IcalTicketsController < ApplicationController - before_filter { authentication_check_action_token 'iCal' } + before_action { authentication_check_action_token 'iCal' } # @path [GET] /ical/tickets_all/:action_token # diff --git a/app/controllers/jobs_controller.rb b/app/controllers/jobs_controller.rb index e01b2927b..778523d3f 100644 --- a/app/controllers/jobs_controller.rb +++ b/app/controllers/jobs_controller.rb @@ -1,7 +1,7 @@ # Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/ class JobsController < ApplicationController - before_filter :authentication_check + before_action :authentication_check def index return if deny_if_not_role(Z_ROLENAME_ADMIN) diff --git a/app/controllers/links_controller.rb b/app/controllers/links_controller.rb index 06d3c64ab..1ef4d2453 100644 --- a/app/controllers/links_controller.rb +++ b/app/controllers/links_controller.rb @@ -1,7 +1,7 @@ # Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/ class LinksController < ApplicationController - before_filter :authentication_check + before_action :authentication_check # GET /api/v1/links def index diff --git a/app/controllers/network_controller.rb b/app/controllers/network_controller.rb index 310145cc3..5192ef4ef 100644 --- a/app/controllers/network_controller.rb +++ b/app/controllers/network_controller.rb @@ -1,7 +1,7 @@ # Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/ class NetworksController < ApplicationController - before_filter :authentication_check + before_action :authentication_check # GET /networks # GET /networks.json diff --git a/app/controllers/object_manager_attributes_controller.rb b/app/controllers/object_manager_attributes_controller.rb index 7e61985c5..6a42b73fd 100644 --- a/app/controllers/object_manager_attributes_controller.rb +++ b/app/controllers/object_manager_attributes_controller.rb @@ -1,7 +1,7 @@ # Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/ class ObjectManagerAttributesController < ApplicationController - before_filter :authentication_check + before_action :authentication_check # GET /object_manager_attributes_list def list diff --git a/app/controllers/online_notifications_controller.rb b/app/controllers/online_notifications_controller.rb index abe8c8c50..95daa2d0b 100644 --- a/app/controllers/online_notifications_controller.rb +++ b/app/controllers/online_notifications_controller.rb @@ -1,7 +1,7 @@ # Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/ class OnlineNotificationsController < ApplicationController - before_filter :authentication_check + before_action :authentication_check =begin diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb index d5bf431f9..b51389feb 100644 --- a/app/controllers/organizations_controller.rb +++ b/app/controllers/organizations_controller.rb @@ -1,7 +1,7 @@ # Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/ class OrganizationsController < ApplicationController - before_filter :authentication_check + before_action :authentication_check =begin diff --git a/app/controllers/overviews_controller.rb b/app/controllers/overviews_controller.rb index cdf3962a2..e430b3351 100644 --- a/app/controllers/overviews_controller.rb +++ b/app/controllers/overviews_controller.rb @@ -1,7 +1,7 @@ # Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/ class OverviewsController < ApplicationController - before_filter :authentication_check + before_action :authentication_check =begin diff --git a/app/controllers/packages_controller.rb b/app/controllers/packages_controller.rb index 49e291bb7..f8732547e 100644 --- a/app/controllers/packages_controller.rb +++ b/app/controllers/packages_controller.rb @@ -1,7 +1,7 @@ # Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/ class PackagesController < ApplicationController - before_filter :authentication_check + before_action :authentication_check # GET /api/v1/packages def index diff --git a/app/controllers/postmaster_filters_controller.rb b/app/controllers/postmaster_filters_controller.rb index ba4f1154b..6a51dc6aa 100644 --- a/app/controllers/postmaster_filters_controller.rb +++ b/app/controllers/postmaster_filters_controller.rb @@ -1,7 +1,7 @@ # Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/ class PostmasterFiltersController < ApplicationController - before_filter :authentication_check + before_action :authentication_check =begin diff --git a/app/controllers/recent_view_controller.rb b/app/controllers/recent_view_controller.rb index 9304225d6..0d52a8309 100644 --- a/app/controllers/recent_view_controller.rb +++ b/app/controllers/recent_view_controller.rb @@ -1,7 +1,7 @@ # Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/ class RecentViewController < ApplicationController - before_filter :authentication_check + before_action :authentication_check =begin diff --git a/app/controllers/roles_controller.rb b/app/controllers/roles_controller.rb index a229964aa..b8ea0d75a 100644 --- a/app/controllers/roles_controller.rb +++ b/app/controllers/roles_controller.rb @@ -1,7 +1,7 @@ # Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/ class RolesController < ApplicationController - before_filter :authentication_check + before_action :authentication_check =begin diff --git a/app/controllers/rss_controller.rb b/app/controllers/rss_controller.rb index 832124e3a..3a38bbf5f 100644 --- a/app/controllers/rss_controller.rb +++ b/app/controllers/rss_controller.rb @@ -1,7 +1,7 @@ # Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/ class RssController < ApplicationController - before_filter :authentication_check + before_action :authentication_check =begin diff --git a/app/controllers/search_controller.rb b/app/controllers/search_controller.rb index a7e5e3529..fe134da09 100644 --- a/app/controllers/search_controller.rb +++ b/app/controllers/search_controller.rb @@ -1,7 +1,7 @@ # Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/ class SearchController < ApplicationController - before_filter :authentication_check + before_action :authentication_check # GET /api/v1/search_user_org def search_user_org diff --git a/app/controllers/settings_controller.rb b/app/controllers/settings_controller.rb index 95a67e850..189ee794b 100644 --- a/app/controllers/settings_controller.rb +++ b/app/controllers/settings_controller.rb @@ -1,7 +1,7 @@ # Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/ class SettingsController < ApplicationController - before_filter :authentication_check + before_action :authentication_check # GET /settings def index diff --git a/app/controllers/signatures_controller.rb b/app/controllers/signatures_controller.rb index f7febce4f..825b48d84 100644 --- a/app/controllers/signatures_controller.rb +++ b/app/controllers/signatures_controller.rb @@ -1,7 +1,7 @@ # Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/ class SignaturesController < ApplicationController - before_filter :authentication_check + before_action :authentication_check =begin diff --git a/app/controllers/slas_controller.rb b/app/controllers/slas_controller.rb index 4be849765..17b1d809c 100644 --- a/app/controllers/slas_controller.rb +++ b/app/controllers/slas_controller.rb @@ -1,7 +1,7 @@ # Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/ class SlasController < ApplicationController - before_filter :authentication_check + before_action :authentication_check =begin diff --git a/app/controllers/tags_controller.rb b/app/controllers/tags_controller.rb index da7015341..de6d247aa 100644 --- a/app/controllers/tags_controller.rb +++ b/app/controllers/tags_controller.rb @@ -1,7 +1,7 @@ # Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/ class TagsController < ApplicationController - before_filter :authentication_check + before_action :authentication_check # GET /api/v1/tags def index diff --git a/app/controllers/taskbar_controller.rb b/app/controllers/taskbar_controller.rb index db5b8b9ff..e93cb3f10 100644 --- a/app/controllers/taskbar_controller.rb +++ b/app/controllers/taskbar_controller.rb @@ -1,7 +1,7 @@ # Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/ class TaskbarController < ApplicationController - before_filter :authentication_check + before_action :authentication_check def index diff --git a/app/controllers/templates_controller.rb b/app/controllers/templates_controller.rb index 6759c08f9..f12e70b72 100644 --- a/app/controllers/templates_controller.rb +++ b/app/controllers/templates_controller.rb @@ -1,7 +1,7 @@ # Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/ class TemplatesController < ApplicationController - before_filter :authentication_check + before_action :authentication_check =begin diff --git a/app/controllers/text_modules_controller.rb b/app/controllers/text_modules_controller.rb index 299a4a430..40060f92f 100644 --- a/app/controllers/text_modules_controller.rb +++ b/app/controllers/text_modules_controller.rb @@ -1,7 +1,7 @@ # Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/ class TextModulesController < ApplicationController - before_filter :authentication_check + before_action :authentication_check =begin diff --git a/app/controllers/ticket_articles_controller.rb b/app/controllers/ticket_articles_controller.rb index b4bbc61fd..0901ff793 100644 --- a/app/controllers/ticket_articles_controller.rb +++ b/app/controllers/ticket_articles_controller.rb @@ -1,7 +1,7 @@ # Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/ class TicketArticlesController < ApplicationController - before_filter :authentication_check + before_action :authentication_check # GET /articles def index diff --git a/app/controllers/ticket_overviews_controller.rb b/app/controllers/ticket_overviews_controller.rb index c83754b26..f74a634ba 100644 --- a/app/controllers/ticket_overviews_controller.rb +++ b/app/controllers/ticket_overviews_controller.rb @@ -3,7 +3,7 @@ require 'ticket/overviews' class TicketOverviewsController < ApplicationController - before_filter :authentication_check + before_action :authentication_check # GET /api/v1/ticket_overviews def show diff --git a/app/controllers/ticket_priorities_controller.rb b/app/controllers/ticket_priorities_controller.rb index 1145b9ca7..6056abdfa 100644 --- a/app/controllers/ticket_priorities_controller.rb +++ b/app/controllers/ticket_priorities_controller.rb @@ -1,7 +1,7 @@ # Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/ class TicketPrioritiesController < ApplicationController - before_filter :authentication_check + before_action :authentication_check # GET /ticket_priorities def index diff --git a/app/controllers/ticket_states_controller.rb b/app/controllers/ticket_states_controller.rb index 61fd71678..f0bd2b2c7 100644 --- a/app/controllers/ticket_states_controller.rb +++ b/app/controllers/ticket_states_controller.rb @@ -1,7 +1,7 @@ # Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/ class TicketStatesController < ApplicationController - before_filter :authentication_check + before_action :authentication_check # GET /ticket_states def index diff --git a/app/controllers/tickets_controller.rb b/app/controllers/tickets_controller.rb index a67d48f34..2d100c581 100644 --- a/app/controllers/tickets_controller.rb +++ b/app/controllers/tickets_controller.rb @@ -1,7 +1,7 @@ # Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/ class TicketsController < ApplicationController - before_filter :authentication_check + before_action :authentication_check # GET /api/v1/tickets def index diff --git a/app/controllers/translations_controller.rb b/app/controllers/translations_controller.rb index 1f74e6c28..cb6a27ed2 100644 --- a/app/controllers/translations_controller.rb +++ b/app/controllers/translations_controller.rb @@ -1,7 +1,7 @@ # Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/ class TranslationsController < ApplicationController - before_filter :authentication_check, except: [:load] + before_action :authentication_check, except: [:load] # GET /translations/lang/:locale def load diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 23756e83e..eaf6e269a 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -1,7 +1,7 @@ # Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/ class UsersController < ApplicationController - before_filter :authentication_check, except: [:create, :password_reset_send, :password_reset_verify] + before_action :authentication_check, except: [:create, :password_reset_send, :password_reset_verify] # @path [GET] /users #