File tree Expand file tree Collapse file tree 3 files changed +12
-5
lines changed Expand file tree Collapse file tree 3 files changed +12
-5
lines changed Original file line number Diff line number Diff line change 1
1
### 0.5.1 (Next)
2
2
3
+ * [ TODO] ( https://github.com/ruby-grape/grape-swagger-rails/pull/TODO ) : Rails 7 compatibility - [ @padde ] ( https://github.com/padde ) .
3
4
* Your contribution here.
4
5
5
6
### 0.5.0 (2024/04/06)
Original file line number Diff line number Diff line change 6
6
module GrapeSwaggerRails
7
7
class Options < OpenStruct
8
8
def before_filter ( &block )
9
- ActiveSupport :: Deprecation . warn ( 'This option is deprecated and going to be removed in 1.0.0. ' \
10
- 'Please use `before_action` instead' )
9
+ GrapeSwaggerRails . deprecator . warn ( 'This option is deprecated and going to be removed in 1.0.0. ' \
10
+ 'Please use `before_action` instead' )
11
11
before_action ( &block )
12
12
end
13
13
@@ -43,4 +43,8 @@ def before_action(&block)
43
43
hide_url_input : false ,
44
44
hide_api_key_input : false
45
45
)
46
+
47
+ def self . deprecator
48
+ @deprecator ||= ActiveSupport ::Deprecation . new ( '1.0' , 'GrapeSwaggerRails' )
49
+ end
46
50
end
Original file line number Diff line number Diff line change 171
171
172
172
describe '#before_filter' do
173
173
before do
174
- allow ( ActiveSupport :: Deprecation ) . to receive ( :warn )
174
+ allow ( GrapeSwaggerRails . deprecator ) . to receive ( :warn )
175
175
end
176
176
177
177
it 'throws deprecation warning' do
178
178
GrapeSwaggerRails . options . before_filter { true }
179
179
180
- expect ( ActiveSupport ::Deprecation ) . to have_received ( :warn ) . with ( 'This option is deprecated ' \
181
- 'and going to be removed in 1.0.0. Please use `before_action` instead' )
180
+ expect ( GrapeSwaggerRails . deprecator ) . to have_received ( :warn ) . with (
181
+ 'This option is deprecated and going to be removed in 1.0.0. ' \
182
+ 'Please use `before_action` instead'
183
+ )
182
184
end
183
185
end
184
186
You can’t perform that action at this time.
0 commit comments