Upgrade/rails 8.1 rubocop#1053
Open
pdl wants to merge 8 commits intochimera/upgrade-rails-devopsfrom
Open
Conversation
Replace: \bend\n(?!$|\n|\s*(?:end\b|elsif\b|else\b|\]|\)|\})) With: end\n\n In: app/**/*.rb,lib/**/*.rb,lib/**/*.rake,spec/**/*.rb Replace: \n(\x20+)([^\x20\n#].*)(?<!,)\n\1([^\s#].*) (do|def|begin|class)(?![\S]) With: \n$1$2\n\n$1$3 $4 In: app/**/*.rb,lib/**/*.rb,lib/**/*.rake,spec/**/*.rb
Contributor
Author
|
@leonardow-unep-wcmc FYI only, keeping this a separate PR for now. |
| select('taxon_concept_id, sum(quantity) as count_all'). | ||
| group(:taxon_concept_id). | ||
| order('count_all desc'). | ||
| order(count_all: :desc). |
Contributor
There was a problem hiding this comment.
This may not work as symbol because count_all is not a normal column.
Contributor
Author
There was a problem hiding this comment.
Tested with:
Trade::Shipment.
select('taxon_concept_id, sum(quantity) as count_all').
where(taxon_concept_id: ..200).
group(:taxon_concept_id).
order(count_all: :desc) # or 'count_all desc'And they return the same order.
| where.not(user_id: nil) | ||
| self.from("(#{subquery.to_sql}) AS api_requests"). | ||
| order('cnt DESC').limit(50) | ||
| order(cnt: :desc).limit(50) |
Contributor
There was a problem hiding this comment.
same issue like count_all
| def self.years_array | ||
| self.select('EXTRACT(year from start_date)::VARCHAR years'). | ||
| group(:years).order('years DESC').map(&:years) | ||
| group(:years).order(years: :desc).map(&:years) |
| where([ "properties->>'taxonomy_name' = ?", @taxonomy ]). | ||
| group("properties->>'id', properties->>'full_name'"). | ||
| order('number_of_visits DESC') | ||
| order(number_of_visits: :desc) |
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.
Fixing the rubocop config and running it for rails 8.1.