| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
To be removed in Rails 6.0 (default for the deprecate helper). Code
moved around as well for the ActiveSupport::Deprecation modules, since
it was dependent on ActiveSupport::Inflector being loaded for it to
work. By "lazy loading" the Inflector code from within the Deprecation
code, we can require ActiveSupport::Deprecation from
ActiveSupport::Inflector and not get a circular dependency issue.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The Problem
-----------
The following line from `String#camelize`:
string = string.sub(/^(?:#{inflections.acronym_regex}(?=\b|[A-Z_])|\w)/) { |match| match.downcase }
and the following line from `String#camelize`:
word.gsub!(/(?:(?<=([A-Za-z\d]))|\b)(#{inflections.acronym_regex})(?=\b|[^a-z])/) { "#{$1 && '_'.freeze }#{$2.downcase}" }#{$2.downcase}" }
Both generate the same regexep in the first part of the `.sub`/`.gsub`
method calls every time the function is called, creating an extra object
allocation each time. The value of `acronym_regex` only changes if the
user decides add an acronym to the current set of inflections and apends
another string on the the regexp generated here, but beyond that it
remains relatively static.
This has been around since acronym support was introduced back in 2011
in PR#1648.
Proposed Solution
-----------------
To avoid re-generating these strings every time these methods are
called, cache the values of these regular expressions in the
`ActiveSupport::Inflector::Inflections` instance, making it so these
regular expressions are only generated once, or when the acronym's are
added to.
Other notable changes is the attr_readers are nodoc'd, as they shouldn't
really be public APIs for users. Also, the new method,
define_acronym_regex_patterns, is the only method in charge of
manipulating @acronym_regex, and initialize_dup also makes use of that
new change.
** Note about fix for non-deterministic actionpack test **
With the introduction of `@acronym_underscore_regex` and
`@acronym_camelize_regex`, tests that manipulated these for a short
time, then reset them could caused test failures to happen. This
happened because the previous way we reset the `@acronyms` and
`@acronym_regex` was the set them using #instance_variable_set, which
wouldn't run the #define_acronym_regex_patterns method.
This has now been introduced into the actionpack tests to avoid this
failure.
|
|
|
|
|
|
|
|
| |
It should be shared the count of alias tracking in both INNER/LEFT JOINs
to avoid duplicate aliases.
Fixes #30504.
Closes #30410.
|
|
|
|
|
| |
Currently we have no test for alias tracking with string joins. I've add
test case for that to catch a future regression.
|
| |
|
|
|
|
|
| |
Since `MocktailDesigner` inherits `DrinkDesigner` and can not be used
alone.
|
| |
|
| |
|
|\
| |
| | |
Add changelog entry about new `allow_other_host` option for `redirect_back` method
|
| |
| |
| |
| |
| |
| | |
method [ci skip]
Related to #30850
|
|\ \
| | |
| | | |
ActiveStorage install note [skip ci]
|
| | | |
|
|\ \ \
| | | |
| | | | |
Adds descriptions to rails-ujs methods [ci skip]
|
| | | | |
|
| |_|/
|/| |
| | |
| | |
| | |
| | |
| | |
| | | |
Because `options` here is not AS::HWIA but an instance of Thor::CoreExt::HWIA
that looks very similar to ours but behaves slightly different, we need to keep
this object be an instance of Thor::CoreExt::HWIA.
Since Ruby 2.5 has Hash#slice that returns a new Hash instance now,
we need to avoid calling `slice` on this tricky object.
|
| | | |
|
| | |
| | |
| | |
| | | |
This basically reverts f851e1f705f26d8f92f0fc1b265b20bc389d23cb
|
| | |
| | |
| | |
| | | |
This basically reverts fef234f1f0a238c2277459652861144ae89501ff
|
| | |
| | |
| | |
| | | |
This basically reverts cd9cc721ab54e2b0c7875cacf2113f03908a8bb7
|
| | |
| | |
| | |
| | | |
This basically reverts c4d1a4efeec6f0b5b58222993aa0bec85a19b6a8
|
| | |
| | |
| | |
| | |
| | | |
This basically reverts e9fca7668b9eba82bcc832cb0061459703368397, d08da958b9ae17d4bbe4c9d7db497ece2450db5f,
d1fe1dcf8ab1c0210a37c2a78c1ee52cf199a66d, and 68eaf7b4d5f2bb56d939f71c5ece2d61cf6680a3
|
| | |
| | |
| | |
| | | |
This basically reverts 9d4f79d3d394edb74fa2192e5d9ad7b09ce50c6d
|
| | |
| | |
| | |
| | | |
This basically reverts ee5cfc01a5797f854c8441539b0cae326a81b963
|
| | |
| | |
| | |
| | | |
This basically reverts 8da30ad6be34339124ba4cb4e36aea260dda12bc
|
| | |
| | |
| | |
| | | |
This basically reverts 618268b4b9382f4bcf004a945fe2d85c0bd03e32
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
In order to keep this method compatible with the Ruby 2.5 version of Hash#slice.
This bahavior is actually slightly incompatibile with previous versions of Active Support
but it might not cause a real problem, since HWIA, the biggest use case of Hash subclassing here,
already overrides `slice` to return another HWIA.
|
| | | |
|
| | |
| | |
| | |
| | | |
since r60229
|
| | |
| | |
| | |
| | | |
It should be initialized only when polymorphic associations.
|
| | |
| | |
| | |
| | | |
"The dependency activerecord-jdbcsqlite3-adapter (>= 1.3.0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby, x64-mingw32, x86-mingw32 but the dependency is only for java. To add those platforms to the bundle, run `bundle lock --add-platform java`."
|
|\ \ \
| | | |
| | | | |
Allow symbol list for ignored_columns
|
| | | | |
|
|\ \ \ \
| | | | |
| | | | | |
Remove obsolete documentation for html_escape [ci skip]
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Instructions to use `h` or `html_escape` in ERB templates were added to
`actionpack/lib/action_view/template_handlers/erb.rb` in a1b0349 (Rails
2.1), but ERB has automatically escaped values since Rails 3.
|
|\ \ \ \ \
| |/ / / /
|/| | | | |
Return correct exit status of ujs test
|
|/ / / /
| | | |
| | | |
| | | |
| | | |
| | | | |
The `Process::Status#to_i` returns the bits in stat. If need exit status,
need to use `#exitstatus`.
Ref: https://ruby-doc.org/core-2.4.0/Process/Status.html#method-i-to_i
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
`:api:` tag was removed in 5349f231 since RDoc doesn't support `:api:`
tag. But those methods are not private API, they are public API for
renderers. The renderers should be able to know that they can override
this method.
|
|\ \ \ \
| |/ / /
|/| | | |
PhantomJS is abandoned, replace it with Selenium/Chrome headless
|
| | | | |
|
|/ / / |
|
|\ \ \
| | | |
| | | | |
Fix callback in rails ujs
|
| | | | |
|
| | | | |
|
|\ \ \ \
| | | | |
| | | | | |
Remove unused `FixtureTemplate` class
|
|/ / / /
| | | |
| | | |
| | | | |
`FixtureTemplate` is no longer used since 3d7892d.
|
|\ \ \ \
| | | | |
| | | | |
| | | | |
| | | | | |
bogdanvlviv/fix_ar_internal_metadata_for_a_test_database
Fix `bin/rails db:setup` and `bin/rails db:test:prepare` create wrong ar_internal_metadata's data for a test database.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
database connection
When load schema from `structure.sql`, database connection isn't
established. `ActiveRecord::Tasks::DatabaseTasks.load_schema` has to
establish database connection since it executes
```
ActiveRecord::InternalMetadata.create_table
ActiveRecord::InternalMetadata[:environment] = environment
```
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
ar_internal_metadata's data for a test database.
Before:
```
$ RAILS_ENV=test rails dbconsole
> SELECT * FROM ar_internal_metadata;
key|value|created_at|updated_at
environment|development|2017-09-11 23:14:10.815679|2017-09-11 23:14:10.815679
```
After:
```
$ RAILS_ENV=test rails dbconsole
> SELECT * FROM ar_internal_metadata;
key|value|created_at|updated_at
environment|test|2017-09-11 23:14:10.815679|2017-09-11 23:14:10.815679
```
Fixes #26731.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Improve out-of-box experience with System tests including chromedriver-helper by default
|
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
chromedriver-helper by default
|