diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 80bca004..1bacd50d 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -12,13 +12,13 @@ class ApplicationController < ActionController::Base layout proc{ |controller| controller.mobile? ? "mobile" : "application" } # exempt_from_layout /\.js\.erb$/ - before_filter :set_session_expiration - before_filter :set_time_zone - before_filter :set_zindex_counter - before_filter :set_locale - append_before_filter :set_group_view_by - prepend_before_filter :login_required - prepend_before_filter :enable_mobile_content_negotiation + before_action :set_session_expiration + before_action :set_time_zone + before_action :set_zindex_counter + before_action :set_locale + append_before_action :set_group_view_by + prepend_before_action :login_required + prepend_before_action :enable_mobile_content_negotiation def set_locale locale = params[:locale] # specifying a locale in the request takes precedence @@ -119,7 +119,7 @@ class ApplicationController < ActionController::Base # versions. Unfortunately, I ran into a lot of trouble simply registering a # new mime type 'text/html' with format :m because :html already is linked to # that mime type and the new registration was forcing all html requests to be - # rendered in the mobile view. The before_filter and after_filter hackery + # rendered in the mobile view. The before_action and after_filter hackery # below accomplishs that implementation goal by using a 'fake' mime type # during the processing and then setting it to 'text/html' in an # 'after_filter' -LKM 2007-04-01 diff --git a/app/controllers/calendar_controller.rb b/app/controllers/calendar_controller.rb index dc00bcca..b7aa0ff0 100644 --- a/app/controllers/calendar_controller.rb +++ b/app/controllers/calendar_controller.rb @@ -1,6 +1,6 @@ class CalendarController < ApplicationController - skip_before_filter :login_required, :only => [:show] - prepend_before_filter :login_or_feed_token_required, :only => [:show] + skip_before_action :login_required, :only => [:show] + prepend_before_action :login_or_feed_token_required, :only => [:show] def show @source_view = 'calendar' diff --git a/app/controllers/contexts_controller.rb b/app/controllers/contexts_controller.rb index 4e2e4448..c8d36a90 100644 --- a/app/controllers/contexts_controller.rb +++ b/app/controllers/contexts_controller.rb @@ -2,10 +2,10 @@ class ContextsController < ApplicationController helper :todos - before_filter :init, :except => [:index, :create, :destroy, :order] - before_filter :set_context_from_params, :only => [:update, :destroy] - skip_before_filter :login_required, :only => [:index] - prepend_before_filter :login_or_feed_token_required, :only => [:index] + before_action :init, :except => [:index, :create, :destroy, :order] + before_action :set_context_from_params, :only => [:update, :destroy] + skip_before_action :login_required, :only => [:index] + prepend_before_action :login_or_feed_token_required, :only => [:index] def index @all_contexts = current_user.contexts diff --git a/app/controllers/integrations_controller.rb b/app/controllers/integrations_controller.rb index f124dbb2..3a3da549 100644 --- a/app/controllers/integrations_controller.rb +++ b/app/controllers/integrations_controller.rb @@ -1,8 +1,8 @@ class IntegrationsController < ApplicationController require 'mail' - skip_before_filter :login_required, :only => [:cloudmailin, :search_plugin] - skip_before_filter :verify_authenticity_token, only: [:cloudmailin] + skip_before_action :login_required, :only => [:cloudmailin, :search_plugin] + skip_before_action :verify_authenticity_token, only: [:cloudmailin] def index @page_title = 'TRACKS::Integrations' diff --git a/app/controllers/login_controller.rb b/app/controllers/login_controller.rb index dc51582b..4331c550 100644 --- a/app/controllers/login_controller.rb +++ b/app/controllers/login_controller.rb @@ -1,10 +1,10 @@ class LoginController < ApplicationController layout 'login' - skip_before_filter :set_session_expiration - skip_before_filter :login_required - before_filter :login_optional - before_filter :get_current_user + skip_before_action :set_session_expiration + skip_before_action :login_required + before_action :login_optional + before_action :get_current_user protect_from_forgery :except => [:check_expiry, :login] diff --git a/app/controllers/mailgun_controller.rb b/app/controllers/mailgun_controller.rb index 614d185e..50c929a4 100644 --- a/app/controllers/mailgun_controller.rb +++ b/app/controllers/mailgun_controller.rb @@ -2,8 +2,8 @@ require 'openssl' class MailgunController < ApplicationController - skip_before_filter :login_required, :only => [:mailgun] - before_filter :verify, :only => [:mailgun] + skip_before_action :login_required, :only => [:mailgun] + before_action :verify, :only => [:mailgun] protect_from_forgery with: :null_session def mailgun diff --git a/app/controllers/notes_controller.rb b/app/controllers/notes_controller.rb index efeab030..402ca898 100644 --- a/app/controllers/notes_controller.rb +++ b/app/controllers/notes_controller.rb @@ -1,6 +1,6 @@ class NotesController < ApplicationController - before_filter :set_source_view + before_action :set_source_view def index @all_notes = current_user.notes diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index f2e4728d..059ab9ac 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -1,11 +1,11 @@ class ProjectsController < ApplicationController helper :application, :todos, :notes - before_filter :set_source_view - before_filter :set_project_from_params, :only => [:update, :destroy, :show, :edit, :set_reviewed] - before_filter :default_context_filter, :only => [:create, :update] - skip_before_filter :login_required, :only => [:index] - prepend_before_filter :login_or_feed_token_required, :only => [:index] + before_action :set_source_view + before_action :set_project_from_params, :only => [:update, :destroy, :show, :edit, :set_reviewed] + before_action :default_context_filter, :only => [:create, :update] + skip_before_action :login_required, :only => [:index] + prepend_before_action :login_or_feed_token_required, :only => [:index] def index @source_view = params['_source_view'] || 'project_list' diff --git a/app/controllers/recurring_todos_controller.rb b/app/controllers/recurring_todos_controller.rb index e5d2cbbe..1dbeaef5 100644 --- a/app/controllers/recurring_todos_controller.rb +++ b/app/controllers/recurring_todos_controller.rb @@ -2,8 +2,8 @@ class RecurringTodosController < ApplicationController helper :todos, :recurring_todos - append_before_filter :init, :only => [:index, :new, :edit, :create] - append_before_filter :get_recurring_todo_from_param, :only => [:destroy, :toggle_check, :toggle_star, :edit, :update] + append_before_action :init, :only => [:index, :new, :edit, :create] + append_before_action :get_recurring_todo_from_param, :only => [:destroy, :toggle_check, :toggle_star, :edit, :update] def index @page_title = t('todos.recurring_actions_title') diff --git a/app/controllers/stats_controller.rb b/app/controllers/stats_controller.rb index 7369d456..f217a18f 100644 --- a/app/controllers/stats_controller.rb +++ b/app/controllers/stats_controller.rb @@ -3,7 +3,7 @@ class StatsController < ApplicationController SECONDS_PER_DAY = 86400; helper :todos, :projects, :recurring_todos - append_before_filter :init, :except => :index + append_before_action :init, :except => :index def index @page_title = t('stats.index_title') diff --git a/app/controllers/todos_controller.rb b/app/controllers/todos_controller.rb index 36cc7435..a4e87ce7 100644 --- a/app/controllers/todos_controller.rb +++ b/app/controllers/todos_controller.rb @@ -1,8 +1,8 @@ class TodosController < ApplicationController - skip_before_filter :login_required, :only => [:index, :tag] - prepend_before_filter :login_or_feed_token_required, :only => [:index, :tag] - append_before_filter :find_and_activate_ready, :only => [:index, :list_deferred] + skip_before_action :login_required, :only => [:index, :tag] + prepend_before_action :login_or_feed_token_required, :only => [:index, :tag] + append_before_action :find_and_activate_ready, :only => [:index, :list_deferred] protect_from_forgery :except => :check_deferred diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 0126252c..f33979e6 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -1,8 +1,8 @@ class UsersController < ApplicationController - before_filter :admin_login_required, :only => [ :index, :show, :destroy ] - skip_before_filter :login_required, :only => [ :new, :create ] - prepend_before_filter :login_optional, :only => [ :new, :create ] + before_action :admin_login_required, :only => [ :index, :show, :destroy ] + skip_before_action :login_required, :only => [ :new, :create ] + prepend_before_action :login_optional, :only => [ :new, :create ] # GET /users GET /users.xml def index diff --git a/lib/login_system.rb b/lib/login_system.rb index 52978f4a..999b6fa8 100644 --- a/lib/login_system.rb +++ b/lib/login_system.rb @@ -55,7 +55,7 @@ module LoginSystem true end - # When called with before_filter :login_from_cookie will check for an :auth_token + # When called with before_action :login_from_cookie will check for an :auth_token # cookie and log the user back in if appropriate def login_from_cookie return unless cookies[:auth_token] && !logged_in? @@ -82,7 +82,7 @@ module LoginSystem # login_required filter. add # - # before_filter :login_required + # before_action :login_required # # if the controller should be under any rights management. # for finer access control you can overwrite