| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
The target object for counter cache is not always determined by the
primary key value on the model. I'd like to extract `update_couters`
onto the `Relation` for the internal use.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Ruby 2.4 has native `Regexp#match?`.
https://ruby-doc.org/core-2.4.0/Regexp.html#method-i-match-3F
Related #32034.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Enable regex cops
|
| | | | | | |
|
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
`5 =~ /\d/` returns nil, but Integer doesn't have a `match?` method.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Rubocop warns about "Use String#end_with? instead of a regex match anchored to the end of the string",
it doesn't seem aware of the $` special variable like Performance/RegexpMatch
|
|/ / / / /
| | | | |
| | | | |
| | | | |
| | | | | |
In cases where the MatchData object is not used, this provides a speed-up:
https://github.com/JuanitoFatas/fast-ruby/#stringmatch-vs-stringmatch-vs-stringstart_withstringend_with-code-start-code-end
|
| | | | |
| | | | |
| | | | |
| | | | | |
Clean up some concepts in the code while we're here.
|
| | | | |
| | | | |
| | | | |
| | | | | |
source is ignored (#33455)
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Testing Guide: unnecessary comment
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
This has been around as far back as I can
[see](https://github.com/rails/rails/blob/5137d03cc5b2a5f0820bdcf11b0fffe5bf461470/guides/source/testing.md).
No need to specify the obvious.
[ci skip]
|
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
&& binds tighter than || in JavaScript, but we ought not expect readers to remember language trivia.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Closes #33450.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
* PostgreSQL 10 new relkind for partitioned tables
Starting with PostgreSQL 10, we can now have partitioned tables natively
* Add comment
* Remove extra space
* Add test for partition table in postgreSQL10
* Select 'p' for "BASE TABLE" and add a test case
to support PostgreSQL 10 partition tables
* Address RuboCop offense
* Addressed incorrect `postgresql_version`
Fixes #33008.
[Yannick Schutz & Yasuo Honda & Ryuta Kamizono]
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
Remove Rubocop's comments from Rails code base
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
```
Offenses:
activesupport/lib/active_support/subscriber.rb:91:17:
C: Layout/SpaceAroundOperators: Operator = should be surrounded by a single space.
event = event_stack.pop
```
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
PR#32381 added Rubocop's comments to some tests files in order to
exclude `Performance/RedundantMerge`.
Turn off `Performance` cops for tests files via `Exclude`
in `.rubocop.yml`.
Context https://github.com/rails/rails/pull/32381#discussion_r205212331
|
| | | | | | | |
|
| | | | | | | |
|
|\ \ \ \ \ \ \
| |/ / / / / /
|/| | | | | | |
Add event object subscriptions to AS::Notifications
|
| | | | | | | |
|
| | | | | | | |
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
We don't need to have a special subscribe method for objects. The
regular `subscribe` method is more expensive than a specialized method,
but `subscribe` should not be called frequently. If that turns out to
be a hotspot, we can introduce a specialized method. :)
|
| | | | | | | |
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Fanout notifier can send event objects to subscribers now. Also moved
`end` lower in the `finish!` method to guarantee that CPU time is
shorter than real time.
|
|/ / / / / / |
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
Add cpu time, idle time, and allocations features to log subscriber events
|
| | |_|/ / /
| |/| | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
* Use process clock instead of Time.now
This fixes any issues with the system clock changing and also eliminates
2 object allocations per event.
* Add start! and finish! methods to the event object so we can record
more information
* Adds cpu time, idle time, and allocation count for a particular event.
Co-authored-by: Aaron Patterson <aaron.patterson@gmail.com>
|
|\ \ \ \ \ \
| |/ / / / /
|/| | | | | |
Bump RuboCop to 0.58.2
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
## Summary
RuboCop 0.58.2 was released.
https://github.com/rubocop-hq/rubocop/releases/tag/v0.58.2
And rubocop-0-58 channel is available in Code Climate.
https://github.com/codeclimate/codeclimate/releases/tag/v0.76.0
https://github.com/codeclimate/codeclimate/commit/38f21f0
In addition, the following changes are made in this PR.
- Replace Custom cops with Rails cops
- Add jaro_winkler gem to Gemfile.lock
### Replace Custom cops with Rails cops
These are compatible replacements.
- Replace `CustomCops/AssertNot` cop with `Rails/AssertNot` cop.
- Replace `CustomCops/RefuteNot` cop with `Rails/RefuteMethods` cop.
With this replacement, it was decided to use cop of RuboCop itself.
It removes the code related to CustomCops accordingly.
### Add jaro_winkler gem to Gemfile.lock
Since RuboCop 0.57.0 depends on jaro_winkler gem,
it has been added to Gemfile.lock.
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
Remove third party FIXME
|
| | |/ / / /
| |/| | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
This FIXME belongs to a code example that was imported from the
internet. As we aren't going to do anything about it, I prefer to remove
it so it stops from appearing on searches.
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
AST Guide: install and migrate tasks needed in new app
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
This line refers only to an upgrade situation, but same is need to setup AST in a new application.
[ci skip]
|
|/ / / / / /
| | | | | |
| | | | | | |
Do nothing instead of raising an error when it’s called on an attached blob.
|
|\ \ \ \ \ \
| |_|/ / / /
|/| | | | |
| | | | | |
| | | | | | |
Reference Active Storage instead of third-party libraries in guide
[ci skip]
|
|/ / / / /
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Paperclip has officially been deprecated, so we shouldn't mention it
anymore.
CarrierWave could still be referenced, as there are use cases where it
currently makes more sense, but for simplicity, I thought removing the
mention of third party libraries made sense. If we want to talk about
them, listing "alternatives" within the Active Storage guide could make
more sense.
|
|\ \ \ \ \
| |/ / / /
|/| | | | |
Turn on performance based cops
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Use attr_reader/attr_writer instead of methods
method is 12% slower
Use flat_map over map.flatten(1)
flatten is 66% slower
Use hash[]= instead of hash.merge! with single arguments
merge! is 166% slower
See https://github.com/rails/rails/pull/32337 for more conversation
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Update with_options.rb [ci skip]
|
|/ / / / /
| | | | |
| | | | | |
explicit mapping for enum accepts a Hash not an Array, plus the example is using `.keys` which also exists on hash
|
| | | | |
| | | | |
| | | | |
| | | | | |
Follow up of #33358 for SQLite3.
|
|\ \ \ \ \
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
albertoalmagro/albertoalmagro/prefer-rails-command-over-bin-rails
Prefer rails command over bin/rails
|
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
This commit substitutes references to rails/rake task for rails command
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
With this commit, rails commands usage instructions display now +rails+
instead of +bin/rails+ within their recommendations.
|
| | | | | | |
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
This commit integrates most used previously rake commands into the
above outer list. Ordering is based on their individual predicted
frequency of use.
Separation between bin/rails tasks is also removed to display all
commands at the same level.
It also removes references to rake and tasks and substitutes them
for command.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Substitutes 'in via' for 'by running'
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
As discussed in #33203 rails command already looks for, and runs,
bin/rails if it is present.
We were mixing recommendations within guides and USAGE guidelines,
in some files we recommended using rails, in others bin/rails and
in some cases we even had both options mixed together.
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
Rails guides are now served over https
|