Skip to content

Commit 44a5b7c

Browse files
committedDec 7, 2023
Drop Rails 5.2 support
1 parent 6fd5edb commit 44a5b7c

File tree

9 files changed

+12
-269
lines changed

9 files changed

+12
-269
lines changed
 

‎.github/workflows/ci.yml

-7
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ jobs:
1616
matrix:
1717
ruby: ['2.7', '3.0', '3.1', '3.2']
1818
gemfile:
19-
- rails_5
2019
- rails_6
2120
- rails_6_1
2221
- rails_7
@@ -25,12 +24,6 @@ jobs:
2524
- sidekiq_6
2625
- sidekiq_7
2726
exclude:
28-
- ruby: '3.0'
29-
gemfile: rails_5
30-
- ruby: '3.1'
31-
gemfile: rails_5
32-
- ruby: '3.2'
33-
gemfile: rails_5
3427
- ruby: '3.2'
3528
gemfile: rails_6
3629

‎Appraisals

-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
appraise "rails-5" do
2-
gem "rails", "~> 5.2.0"
3-
end
4-
51
appraise "rails-6" do
62
gem "rails", "~> 6.0.0"
73
end

‎CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
Unreleased
22
----------
33

4+
* [Breaking] Drop Rails 5.2 support
45
* Replace RequestStore dependency with CurrentAttributes. #313 - @excid3
56
* Easy integration with Sidekiq, not requiring to add any configuration to the initializer #314 - @nunommc
67
* Add `scope` support to `acts_as_tenant :account, ->{ with_deleted }` #282 - @adrian-gomez

‎README.md

+9-3
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@ Want to see how it works? Check out [the ActsAsTenant walkthrough video](https:/
3636
Installation
3737
------------
3838

39-
acts_as_tenant will only work on Rails 5.2 and up. This is due to changes made to the handling of `default_scope`, an essential pillar of the gem.
40-
4139
To use it, add it to your Gemfile:
4240

4341
```ruby
@@ -325,7 +323,15 @@ Background Processing libraries
325323

326324
ActsAsTenant supports
327325

328-
- [Sidekiq](//sidekiq.org/) - make sure to place acts_as_tenant gem after sidekiq in your gemfiles;
326+
- ActiveJob - ActsAsTenant will automatically save the current tenant in ActiveJob arguments and set it when the job runs.
327+
328+
- [Sidekiq](//sidekiq.org/)
329+
Add the following code to `config/initializers/acts_as_tenant.rb`:
330+
331+
```ruby
332+
require 'acts_as_tenant/sidekiq'
333+
```
334+
329335
- DelayedJob - [acts_as_tenant-delayed_job](https://github.com/nunommc/acts_as_tenant-delayed_job)
330336

331337
Testing

‎acts_as_tenant.gemspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ Gem::Specification.new do |spec|
1414

1515
spec.require_paths = ["lib"]
1616

17-
spec.add_dependency "rails", ">= 5.2"
17+
spec.add_dependency "rails", ">= 6.0"
1818
end

‎gemfiles/rails_5.gemfile

-14
This file was deleted.

‎gemfiles/rails_5.gemfile.lock

-239
This file was deleted.

‎lib/acts_as_tenant.rb

-1
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,6 @@ def self.should_require_tenant?
151151

152152
ActiveSupport.on_load(:active_record) do |base|
153153
base.include ActsAsTenant::ModelExtensions
154-
require "acts_as_tenant/sidekiq" if defined?(::Sidekiq)
155154
end
156155

157156
ActiveSupport.on_load(:action_controller) do |base|

‎spec/acts_as_tenant/sidekiq_spec.rb

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
require "spec_helper"
2+
require "acts_as_tenant/sidekiq"
23

34
describe "ActsAsTenant::Sidekiq" do
45
let(:account) { Account.new(id: 1234) }

0 commit comments

Comments
 (0)