Skip to content

Commit d9fb175

Browse files
committed
Merge remote-tracking branch 'refs/remotes/origin/master'
2 parents 0eea0ef + 20a3c45 commit d9fb175

File tree

1 file changed

+26
-19
lines changed

1 file changed

+26
-19
lines changed

README.md

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Since January 2013, we've become the official maintainers of the gem after
2727
Using sequel-rails
2828
==================
2929

30-
Using sequel with Rails (5.2.x, 6.x, 7.x) requires a couple minor changes.
30+
Using sequel with Rails (5.2.x, 6.x, 7.x) requires a few minor changes.
3131

3232
First, add the following to your Gemfile (after the `Rails` lines):
3333

@@ -50,35 +50,36 @@ The top of your `config/application.rb` will probably look something like:
5050
# require 'rails/all'
5151

5252
# Instead of 'rails/all', require these:
53-
require "active_model/railtie"
54-
require "active_job/railtie"
55-
# require "active_record/railtie"
56-
require "action_controller/railtie"
57-
require "action_mailer/railtie"
58-
require "action_view/railtie"
59-
require "action_cable/engine"
60-
require "sprockets/railtie"
61-
require "rails/test_unit/railtie"
53+
%w(
54+
action_cable/engine
55+
action_controller/railtie
56+
action_mailer/railtie
57+
action_view/railtie
58+
active_job/railtie
59+
rails/test_unit/railtie
60+
).each do |railtie|
61+
require railtie
62+
rescue LoadError
63+
end
64+
end
6265
```
6366

64-
Then you need to get rid of `ActiveRecord` configurations, that is if you
67+
Then you need to get rid of `ActiveRecord` and `ActiveStorage` configurations, that is if you
6568
didn't generate the new app with `-O` (or the long form `--skip-active-record`):
6669

67-
For example in a fresh `Rails 5.0.0.1`, you would need to remove those lines:
68-
69-
```
70-
config/initializers/new_framework_defaults.rb
71-
line 18: Rails.application.config.active_record.belongs_to_required_by_default = true
72-
```
70+
For example in a fresh `Rails 7`, you would need to remove those lines:
7371

7472
```
7573
config/environments/development.rb
76-
line 38: config.active_record.migration_error = :page_load
74+
line 37: # config.active_storage.service = :local
75+
line 54: # config.active_record.migration_error = :page_load
76+
line 57: # config.active_record.verbose_query_logs = true
7777
```
7878

7979
```
8080
config/environments/production.rb
81-
line 85: config.active_record.dump_schema_after_migration = false
81+
line 41: # config.active_storage.service = :local
82+
line 92: # config.active_record.dump_schema_after_migration = false
8283
```
8384

8485
Starting with sequel-rails 0.4.0.pre3 we don't change default Sequel behaviour
@@ -90,6 +91,12 @@ with content:
9091
require "sequel_rails/railties/legacy_model_config"
9192
```
9293

94+
## Rails 7
95+
96+
Rake `db:*` mappings are currently not supported in Rails 7, so you'll need to use
97+
the `sequel:*` tasks instead. For example, to migrate your database, you'll need to
98+
run `rails sequel:migrate` instead of `rails db:migrate`.
99+
93100
After those changes, you should be good to go!
94101

95102
Features provided by `sequel-rails`

0 commit comments

Comments
 (0)