Skip to content
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

represent_boolean_as_integer is deprecated #2092

Merged
merged 1 commit into from Mar 7, 2019
Merged

Conversation

ahorek
Copy link

@ahorek ahorek commented Feb 27, 2019

@ahorek ahorek changed the base branch from master to 4-0-dev February 27, 2019 21:24
@ahorek ahorek changed the base branch from 4-0-dev to master February 27, 2019 22:10
@ahorek ahorek changed the base branch from master to 4-0-dev February 27, 2019 22:11
@JonRowe
Copy link
Member

JonRowe commented Feb 27, 2019

Hm, I'm not sure I know what that file did, @samphippen ?

@fables-tales
Copy link
Member

I’d be willing to accept this if it came with a test for rails 6 specifically that demonstrated the behaviour.

@eugeneius
Copy link
Contributor

Rails 5.2 emits a deprecation warning if you don't set represent_boolean_as_integer; Rails 6 will emit a deprecation warning if you do set it. I think the only reason this file exists is to suppress the warning, and the actual behaviour toggled by the setting is irrelevant to RSpec Rails.

This change will fix the failures that are currently blocking the Rails master build on the 4-0-dev branch, so I don't think it needs a test: https://travis-ci.org/rspec/rspec-rails/jobs/499526847#L2084

@JonRowe
Copy link
Member

JonRowe commented Mar 6, 2019

@eugeneius it does, because it also affects older rails versions, at the very least something need gating

@ahorek
Copy link
Author

ahorek commented Mar 6, 2019

@JonRowe I will gladly add a test, but I'm not sure what exactly should be tested...?

this change is just about silencing a deprecation warning in the example app
Rails.application.config.active_record.sqlite3.represent_boolean_as_integer = true
on Rails 6 this file isn't generated, because it's already a default value
on prior Rails versions the file is still generated like before, so the behaviour wasn't actually changed

@JonRowe
Copy link
Member

JonRowe commented Mar 7, 2019

Actually having reviewed the output a bit more closely I'm willing to accept this as is, the failing tests show this polluting the output with a warning and thus this should remove them.

I guess the way to test it in isolation would be to assert no warning output was captured by the generator.

@JonRowe JonRowe merged commit 6d48ef6 into rspec:4-0-dev Mar 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants