-
Notifications
You must be signed in to change notification settings - Fork 4
Rails 7 support #33
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
Rails 7 support #33
Changes from all commits
7629462
c1d48cb
87251b2
52801af
e71e743
9368cf7
efd2f23
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 |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| DATABASE_URL="mysql2://root:@mysql/" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,3 +11,4 @@ | |
| .rspec_status | ||
|
|
||
| gemfiles/*.lock | ||
| .env.local | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,11 @@ | ||
| appraise "rails-6.0" do | ||
| gem "rails", "~> 6.0.0" | ||
| appraise "rails-6.1" do | ||
| gem "rails", "~> 6.1" | ||
| end | ||
|
|
||
| appraise "rails-6.1" do | ||
| gem "rails", "~> 6.1.0" | ||
| appraise "rails-7.0" do | ||
| gem "rails", "~> 7.0" | ||
| end | ||
|
|
||
| # Rails 7.0 doesn't work yet | ||
| # appraise "rails-7.0" do | ||
| # gem "rails", "~> 7.0" | ||
| # end | ||
| appraise "rails-7.1" do | ||
| gem "rails", "~> 7.1" | ||
| end |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| source "https://rubygems.org" | ||
|
|
||
| git_source(:github) {|repo_name| "https://github.com/#{repo_name}" } | ||
| git_source(:github) { |repo_name| "https://github.com/#{repo_name}" } | ||
|
|
||
| # Specify your gem's dependencies in sql_enum.gemspec | ||
| gemspec |
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,6 +2,6 @@ | |
|
|
||
| source "https://rubygems.org" | ||
|
|
||
| gem "rails", "~> 6.1.0" | ||
| gem "rails", "~> 6.1" | ||
|
|
||
| gemspec path: "../" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,6 +2,6 @@ | |
|
|
||
| source "https://rubygems.org" | ||
|
|
||
| gem "rails", "~> 7.0.0" | ||
| gem "rails", "~> 7.0" | ||
|
|
||
| gemspec path: "../" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,6 +2,6 @@ | |
|
|
||
| source "https://rubygems.org" | ||
|
|
||
| gem "rails", "~> 5.1.0" | ||
| gem "rails", "~> 7.1" | ||
|
|
||
| gemspec path: "../" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| module SqlEnum | ||
| VERSION = "0.4.0" | ||
| VERSION = "1.0.0" | ||
| end |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,3 @@ | ||
| require 'spec_helper' | ||
|
|
||
| RSpec.describe SqlEnum do | ||
| it "has a version number" do | ||
| expect(SqlEnum::VERSION).not_to be_nil | ||
|
|
@@ -11,12 +9,12 @@ | |
|
|
||
| before do | ||
| SqlEnum.configure { |config| config.default_prefix = true } | ||
|
|
||
| define_model('Task', | ||
| status: [:enum, limit: statuses, default: 'pending'], | ||
| priority: [:enum, limit: priorities]) do | ||
| sql_enum :status | ||
| sql_enum :priority, _prefix: false, _suffix: true | ||
| sql_enum :status # duplicate should be no-op | ||
|
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. Is there a way to directly test that this is in fact a no-op? I'm worried about the possibility of someone re-declaring using different options, then not understanding why their declaration doesn't work. In fact, should this
Collaborator
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. Open to suggestions, this was from @dpep's PR, so maybe he wants to opine... |
||
| end | ||
| end | ||
|
|
||
|
|
||
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.
I think this is reopening the original adapter, is that right? Is that because there are effectively no hooks we could use? Or would this potentially be a good time to move to a proper initializer that hooks the adapter at that point?
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.
I wonder if maybe the thing to do is keep the
register_enum_typemethod here (there are other, similar methods in the adapter already) and move the call of it to a Railtie or somethingThere 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.
My inclination is to get this PR in and then try to mess with that separately?