@@ -27,7 +27,7 @@ Since January 2013, we've become the official maintainers of the gem after
2727Using 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
3232First, 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
6568didn'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```
7573config/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```
8080config/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
8485Starting with sequel-rails 0.4.0.pre3 we don't change default Sequel behaviour
@@ -90,6 +91,12 @@ with content:
9091require " 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+
93100After those changes, you should be good to go!
94101
95102Features provided by ` sequel-rails `
0 commit comments