Commit 5411b51
committed
Remove Rails 5/6 compatibility code
Since we now require Rails 7.0+, removed all EOL version checks:
1. spec/dummy/config/environments/test.rb (lines 19-25)
Removed: if config.respond_to?(:public_file_server) check and else branch
Justification: config.public_file_server was introduced in Rails 5.0.
The old serve_static_files API was deprecated in Rails 5.0 and removed
in Rails 5.1. Since we require Rails 7.0+, we can safely use
public_file_server directly.
Reference: https://guides.rubyonrails.org/5_0_release_notes.html
2. spec/dummy/config/initializers/wrap_parameters.rb (line 11)
Removed: if respond_to?(:wrap_parameters) check
Justification: wrap_parameters was introduced in Rails 3.1 (August 2011).
This check was only needed for Rails 3.0 compatibility. Since we require
Rails 7.0+, this method is always available.
Reference: https://api.rubyonrails.org/v7.0/classes/ActionController/ParamsWrapper.html
3. spec/dummy/config/initializers/assets.rb (line 7)
Removed: if Rails.application.config.respond_to?(:assets) check
Justification: The assets config has been available since Rails 3.1 with
the asset pipeline. This check was for Rails 3.0 compatibility. Even in
Rails 7+ (where asset pipeline is optional), the config still exists.
Reference: https://guides.rubyonrails.org/asset_pipeline.html
4. lib/vault/encrypted_model.rb (lines 332-340)
Removed: Version checks for Rails 5.1, 5.2, and 6.0 change tracking APIs
Justification: Rails 5.1 introduced saved_change_to_attribute?. Rails 5.2
added previous_changes_include? for deprecation transition. Rails 6.0
standardized on previous_changes.include?(). The old attribute_changed?
API was deprecated in Rails 5.1 and removed in Rails 6.0. Since we require
Rails 7.0+, we can use only previous_changes.include?(attribute).
Reference: https://api.rubyonrails.org/v7.0/classes/ActiveModel/Dirty.html
Migration guide: https://github.com/rails/rails/blob/v6.0.0/guides/source/6_0_release_notes.md1 parent 1497b9c commit 5411b51
File tree
4 files changed
+5
-20
lines changed- lib/vault
- spec/dummy/config
- environments
- initializers
4 files changed
+5
-20
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
329 | 329 | | |
330 | 330 | | |
331 | 331 | | |
332 | | - | |
333 | | - | |
334 | | - | |
335 | | - | |
336 | | - | |
337 | | - | |
338 | | - | |
339 | | - | |
340 | | - | |
| 332 | + | |
341 | 333 | | |
342 | 334 | | |
343 | 335 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
| 19 | + | |
| 20 | + | |
26 | 21 | | |
27 | 22 | | |
28 | 23 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | | - | |
9 | | - | |
| 7 | + | |
10 | 8 | | |
11 | 9 | | |
12 | 10 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
0 commit comments