Skip to content

Commit 8d5bab7

Browse files
eileencodespixeltrix
authored andcommitted
Change *_filter to *_action
`before_filter` is now `before_action`. I've changed this to remove the deprecation warning.
1 parent 6ae36ce commit 8d5bab7

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ authentication and other restrictions on whether someone is allowed
2929
to execute such action.
3030

3131
class ListsController < ApplicationController
32-
before_filter :authenticate, except: :public
32+
before_action :authenticate, except: :public
3333

3434
caches_page :public
3535
caches_action :index, :show
@@ -72,7 +72,7 @@ interval (in seconds) to schedule expiration of the cached item.
7272
The following example depicts some of the points made above:
7373

7474
class ListsController < ApplicationController
75-
before_filter :authenticate, except: :public
75+
before_action :authenticate, except: :public
7676

7777
caches_page :public
7878

lib/action_controller/caching/actions.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ module Caching
1010
# to execute such action.
1111
#
1212
# class ListsController < ApplicationController
13-
# before_filter :authenticate, except: :public
13+
# before_action :authenticate, except: :public
1414
#
1515
# caches_page :public
1616
# caches_action :index, :show
@@ -66,7 +66,7 @@ module Caching
6666
#
6767
#
6868
# class ListsController < ApplicationController
69-
# before_filter :authenticate, except: :public
69+
# before_action :authenticate, except: :public
7070
#
7171
# caches_page :public
7272
#
@@ -113,7 +113,7 @@ def caches_action(*actions)
113113
filter_options = options.extract!(:if, :unless).merge(only: actions)
114114
cache_options = options.extract!(:layout, :cache_path).merge(store_options: options)
115115

116-
around_filter ActionCacheFilter.new(cache_options), filter_options
116+
around_action ActionCacheFilter.new(cache_options), filter_options
117117
end
118118
end
119119

test/caching_test.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ class ActionCachingTestController < CachingController
2525
end
2626

2727
# Eliminate uninitialized ivar warning
28-
before_filter { @title = nil }
28+
before_action { @title = nil }
2929

30-
before_filter only: :with_symbol_format do
30+
before_action only: :with_symbol_format do
3131
request.params[:format] = :json
3232
end
3333

0 commit comments

Comments
 (0)