before_filter is now before_action

This commit is contained in:
Brenda Wallace
2016-11-26 17:20:13 +13:00
parent bcdd2a9167
commit 07c135eeb5
20 changed files with 20 additions and 47 deletions

View File

@@ -121,33 +121,6 @@ Performance/StringReplacement:
- 'app/models/seed.rb'
- 'spec/rails_helper.rb'
# Offense count: 21
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles, Include.
# SupportedStyles: action, filter
# Include: app/controllers/**/*.rb
Rails/ActionFilter:
Exclude:
- 'app/controllers/account_types_controller.rb'
- 'app/controllers/accounts_controller.rb'
- 'app/controllers/alternate_names_controller.rb'
- 'app/controllers/application_controller.rb'
- 'app/controllers/authentications_controller.rb'
- 'app/controllers/comments_controller.rb'
- 'app/controllers/crops_controller.rb'
- 'app/controllers/follows_controller.rb'
- 'app/controllers/gardens_controller.rb'
- 'app/controllers/harvests_controller.rb'
- 'app/controllers/notifications_controller.rb'
- 'app/controllers/order_items_controller.rb'
- 'app/controllers/orders_controller.rb'
- 'app/controllers/plantings_controller.rb'
- 'app/controllers/posts_controller.rb'
- 'app/controllers/products_controller.rb'
- 'app/controllers/roles_controller.rb'
- 'app/controllers/scientific_names_controller.rb'
- 'app/controllers/seeds_controller.rb'
# Offense count: 10
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: strict, flexible

View File

@@ -1,5 +1,5 @@
class AccountTypesController < ApplicationController
before_filter :authenticate_member!
before_action :authenticate_member!
load_and_authorize_resource
# GET /account_types

View File

@@ -1,5 +1,5 @@
class AccountsController < ApplicationController
before_filter :authenticate_member!
before_action :authenticate_member!
load_and_authorize_resource
# GET /accounts

View File

@@ -1,5 +1,5 @@
class AlternateNamesController < ApplicationController
before_filter :authenticate_member!, except: [:index, :show]
before_action :authenticate_member!, except: [:index, :show]
load_and_authorize_resource
# GET /alternate_names

View File

@@ -3,8 +3,8 @@ class ApplicationController < ActionController::Base
include ApplicationHelper
after_filter :store_location
before_filter :set_locale
after_action :store_location
before_action :set_locale
def store_location
if (request.path != "/members/sign_in" &&

View File

@@ -1,5 +1,5 @@
class AuthenticationsController < ApplicationController
before_filter :authenticate_member!
before_action :authenticate_member!
load_and_authorize_resource
# POST /authentications

View File

@@ -1,5 +1,5 @@
class CommentsController < ApplicationController
before_filter :authenticate_member!, except: [:index, :show]
before_action :authenticate_member!, except: [:index, :show]
load_and_authorize_resource
# GET /comments

View File

@@ -1,7 +1,7 @@
require 'will_paginate/array'
class CropsController < ApplicationController
before_filter :authenticate_member!, except: [:index, :hierarchy, :search, :show]
before_action :authenticate_member!, except: [:index, :hierarchy, :search, :show]
load_and_authorize_resource
skip_authorize_resource only: [:hierarchy, :search]

View File

@@ -1,5 +1,5 @@
class FollowsController < ApplicationController
before_filter :authenticate_member!
before_action :authenticate_member!
load_and_authorize_resource
skip_load_resource only: :create

View File

@@ -1,5 +1,5 @@
class GardensController < ApplicationController
before_filter :authenticate_member!, except: [:index, :show]
before_action :authenticate_member!, except: [:index, :show]
load_and_authorize_resource
# GET /gardens

View File

@@ -1,5 +1,5 @@
class HarvestsController < ApplicationController
before_filter :authenticate_member!, except: [:index, :show]
before_action :authenticate_member!, except: [:index, :show]
load_and_authorize_resource
# GET /harvests

View File

@@ -1,6 +1,6 @@
class NotificationsController < ApplicationController
include NotificationsHelper
before_filter :authenticate_member!
before_action :authenticate_member!
load_and_authorize_resource
# GET /notifications

View File

@@ -1,5 +1,5 @@
class OrderItemsController < ApplicationController
before_filter :authenticate_member!
before_action :authenticate_member!
load_and_authorize_resource
# POST /order_items

View File

@@ -1,5 +1,5 @@
class OrdersController < ApplicationController
before_filter :authenticate_member!
before_action :authenticate_member!
load_and_authorize_resource
# GET /orders

View File

@@ -1,5 +1,5 @@
class PlantingsController < ApplicationController
before_filter :authenticate_member!, except: [:index, :show]
before_action :authenticate_member!, except: [:index, :show]
load_and_authorize_resource
# GET /plantings

View File

@@ -1,5 +1,5 @@
class PostsController < ApplicationController
before_filter :authenticate_member!, except: [:index, :show]
before_action :authenticate_member!, except: [:index, :show]
load_and_authorize_resource
# GET /posts

View File

@@ -1,5 +1,5 @@
class ProductsController < ApplicationController
before_filter :authenticate_member!
before_action :authenticate_member!
load_and_authorize_resource
# GET /products

View File

@@ -1,5 +1,5 @@
class RolesController < ApplicationController
before_filter :authenticate_member!
before_action :authenticate_member!
load_and_authorize_resource
# GET /roles

View File

@@ -1,5 +1,5 @@
class ScientificNamesController < ApplicationController
before_filter :authenticate_member!, except: [:index, :show]
before_action :authenticate_member!, except: [:index, :show]
load_and_authorize_resource
# GET /scientific_names

View File

@@ -1,5 +1,5 @@
class SeedsController < ApplicationController
before_filter :authenticate_member!, except: [:index, :show]
before_action :authenticate_member!, except: [:index, :show]
load_and_authorize_resource
# GET /seeds