Draft
Conversation
Rails 5 removed these features from core, instead using a seperate gem. rails/rails#21161
assert_template has been removed (extracted?) to a new gem,
rails-controller-test. We use this all over the place, so this should
just work.
> Failure/Error: expect(response).to render_template("pages/forum")
> NoMethodError:
> assert_template has been extracted to a gem. To continue using it,
> add `gem 'rails-controller-testing'` to your Gemfile.
Simple form added support for Rails 5 in 3.2.1, but only actually fixed bugs introduced by Rails 5 in 3.3.1: https://github.com/heartcombo/simple_form/blob/main/CHANGELOG.md#331
This presumably used to work in the prior versions of Rails or rails-controller-test, but no longer does.
The environment configuration in config/environments/*.rb hasn't been updated to the rails defaults with out modifications, as there are a lot of individual changes and this is best left for future discussions and changes. Especially in the context of another ~8 rails versions to upgrade to get anywhere near the latest, there will be a lot of churn in those files and minimising that where possible is the goal here.
Rails 5 changes the ruby schema format to exclude the indexes from the table creates, and a few other minor changes. This final is completely generated, so it's not really something we need to review, which is why I put it in a separate commit.
Rails 5 changed this to no longer be a prepend, per the devise docs: https://github.com/heartcombo/devise/pull/4033/files
The default will change to :debug in Rails 5, and then back to :info in Rails 6.1. Set it to :info explicitly to get stable behaviour. (The comment mentioning personally-identifiable information is copied from the Rails 8 template.) References: https://guides.rubyonrails.org/v5.0.0/upgrading_ruby_on_rails.html#production-log-level https://www.github.com/rails/rails/pull/39707
Contributor
|
Most likely I got the syntax wrong or the version that supports .or() wrong. Good stuff. |
Member
|
https://stackoverflow.com/questions/7054188/is-it-possible-to-negate-a-scope-in-rails Seems that you can't negate a scope with scope :status_not_pending, -> { where.not(status: STATUS[:pending]) }
scope :closed, -> { status_not_pending.or(past_expiry) }(also I think the comment should've used |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
@bagedevimo I saw your "TODO(Rails5)" and tried to make the change but got errors; I'm creating this PR as a reminder (feel free to close if it's not useful).