-
Notifications
You must be signed in to change notification settings - Fork 36
Upgrade rails to 7.2.x version; clean up unsupported rails and ruby version #64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,3 +21,6 @@ tmp | |
| polymorphic_integer_type_test | ||
| gemfiles/*.lock | ||
| .idea/ | ||
| .ruby-version | ||
| mysql | ||
| polymorphic_integer_type_test-* | ||
This file was deleted.
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,3 +5,4 @@ source "https://rubygems.org" | |
| gemspec path: ".." | ||
|
|
||
| gem "activerecord", github: "rails/rails", branch: "7-0-stable" | ||
| gem "sqlite3", "~> 1.4" | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as above. |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| module PolymorphicIntegerType | ||
| VERSION = "3.2.2" | ||
| VERSION = "3.3.0" | ||
| end |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,18 +23,14 @@ | |
| active_record_version = Gem::Version.new(ActiveRecord::VERSION::STRING) | ||
|
|
||
| ActiveRecord::Base.establish_connection(database_config) | ||
|
|
||
| if active_record_version < Gem::Version.new("5.2") | ||
| ActiveRecord::Migrator.migrate(migrations_path) | ||
| end | ||
|
|
||
| if active_record_version >= Gem::Version.new("5.2") && active_record_version < Gem::Version.new("6.0") | ||
| ActiveRecord::MigrationContext.new(migrations_path).migrate | ||
| end | ||
|
|
||
| if active_record_version >= Gem::Version.new("6.0") | ||
| if active_record_version >= Gem::Version.new("6.1") && active_record_version < Gem::Version.new("7.0") | ||
| ActiveRecord::MigrationContext.new(migrations_path, ActiveRecord::SchemaMigration).migrate | ||
| end | ||
|
|
||
| if active_record_version >= Gem::Version.new("7.0") | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Rails has been back and forth about how to use the MigrationContext https://stackoverflow.com/questions/60974746/what-do-i-pass-to-schema-migration-in-activerecordmigrationcontextnew |
||
| ActiveRecord::MigrationContext.new(migrations_path).migrate | ||
| end | ||
| end | ||
|
|
||
| config.around do |example| | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The newer version (2.x.x) is released but the older rails versions are still pin to use a lower version (~> 1.4).
Reference PR
Only the latest version (7.2.x) is able to use a higher version.