| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Suggested at https://github.com/rails/rails/pull/33876#issuecomment-421176221
|
|
|
|
| |
Follow-up #33853
|
|
|
|
|
|
|
|
|
|
|
| |
Once #33608 merged If users create a new database using MySQL 5.1.x, it will fail to create databases
since MySQL 5.1 does not know `utf8mb4` character set.
This pull request removes `encoding: utf8mb4` from `mysql.yml.tt`
to let create_database method handles default character set by MySQL server version.
`supports_longer_index_key_prefix?` method will need to validate if MySQL 5.5 and 5.6 server configured
correctly to support longer index key prefix, but not yet.
|
|
|
|
|
|
|
|
|
| |
The name of the minitest library is spelled that way: regular font, and
lowercase. Lowercase is used even at the beginning of sentences, see
http://docs.seattlerb.org/minitest/
I double-checked this with @zenspider too (thanks!).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Use utf8mb4 character set by default
`utf8mb4` character set supports supplementary characters including emoji.
`utf8` character set with 3-Byte encoding is not enough to support them.
There was a downside of 4-Byte length character set with MySQL 5.5 and 5.6:
"ERROR 1071 (42000): Specified key was too long; max key length is 767 bytes"
for Rails string data type which is mapped to varchar(255) type.
MySQL 5.7 supports 3072 byte key prefix length by default.
* Remove `DEFAULT COLLATE` from Active Record unit test databases
There should be no "one size fits all" collation in MySQL 5.7.
Let MySQL server choose the default collation for Active Record
unit test databases.
Users can choose their best collation for their databases
by setting `options[:collation]` based on their requirements.
* InnoDB FULLTEXT indexes support since MySQL 5.6
it does not have to use MyISAM storage engine whose maximum key length is 1000 bytes.
Using MyISAM storag engine with utf8mb4 character set would cause
"Specified key was too long; max key length is 1000 bytes"
https://dev.mysql.com/doc/refman/5.6/en/innodb-fulltext-index.html
* References
"10.9.1 The utf8mb4 Character Set (4-Byte UTF-8 Unicode Encoding)"
https://dev.mysql.com/doc/refman/5.7/en/charset-unicode-utf8mb4.html
"10.9.2 The utf8mb3 Character Set (3-Byte UTF-8 Unicode Encoding)"
https://dev.mysql.com/doc/refman/5.7/en/charset-unicode-utf8.html
"14.8.1.7 Limits on InnoDB Tables"
https://dev.mysql.com/doc/refman/5.7/en/innodb-restrictions.html
> If innodb_large_prefix is enabled (the default), the index key prefix limit is 3072 bytes
> for InnoDB tables that use DYNAMIC or COMPRESSED row format.
* CI against MySQL 5.7
Followed this instruction and changed root password to empty string.
https://docs.travis-ci.com/user/database-setup/#MySQL-57
* The recommended minimum version of MySQL is 5.7.9
to support utf8mb4 character set and `innodb_default_row_format`
MySQL 5.7.9 introduces `innodb_default_row_format` to support 3072 byte length index by default.
Users do not have to change MySQL database configuration to support Rails string type.
https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_default_row_format
https://dev.mysql.com/doc/refman/5.7/en/innodb-restrictions.html
> If innodb_large_prefix is enabled (the default),
> the index key prefix limit is 3072 bytes for InnoDB tables that use DYNAMIC or COMPRESSED row format.
* The recommended minimum version of MariaDB is 10.2.2
MariaDB 10.2.2 is the first version of MariaDB supporting `innodb_default_row_format`
Also MariaDB says "MySQL 5.7 is compatible with MariaDB 10.2".
- innodb_default_row_format
https://mariadb.com/kb/en/library/xtradbinnodb-server-system-variables/#innodb_default_row_format
- "MariaDB versus MySQL - Compatibility"
https://mariadb.com/kb/en/library/mariadb-vs-mysql-compatibility/
> MySQL 5.7 is compatible with MariaDB 10.2
- "Supported Character Sets and Collations"
https://mariadb.com/kb/en/library/supported-character-sets-and-collations/
|
|
|
|
|
|
|
|
| |
`spec` is the same variable name as gemspec generated by bundler, and its
intention is easier to understand than a one-letter variable.
https://github.com/bundler/bundler/blob/00fd58eaa69015092ee272c4cb5aa92a5e7ee45c/lib/bundler/templates/newgem/newgem.gemspec.tt#L11
This is follow up on 1c59b4840c58097186022f68427c46e0046c5d0d. `spec` is already in use there.
|
|
|
|
|
| |
This will avoid gems that are made to be private to be pushed to public
repositories.
|
|\
| |
| | |
Make null_store the default cache store in test environment config
|
| | |
|
|\ \
| | |
| | |
| | |
| | | |
steakknife/steakknife/improve-template-generator-actions
add github to template actions, template actions minor refactor
|
| | | |
|
|/ /
| |
| |
| |
| |
| | |
For words like "abuse", Rails cannot derive its singular form from
plural form "abuses" without defining custom inflection rule.
`rails generate model` and its families now emit warning for this case.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
In the system test template, enter a value based on label.
However, since `label` method does not use `titleize` by default.
If generate a value including underscore, cannot find a label and the test
will fail.
```
$ ./bin/rails g scaffold user name:string phone_number:string
$ ./bin/rails t test/system/users_test.rb
E
Error:
UsersTest#test_creating_a_User:
Capybara::ElementNotFound: Unable to find field "Phone Number"
test/system/users_test.rb:18:in `block in <class:UsersTest>'
```
This removes unnecessary `titleize` so that the generated file will pass
even if the attribute contains an underscore.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Purpose metadata prevents cookie values from being
copy-pasted and ensures that the cookie is used only
for its originally intended purpose.
The Purpose and Expiry metadata are embedded inside signed/encrypted
cookies and will not be readable on previous versions of Rails.
We can switch off purpose and expiry metadata embedded in
signed and encrypted cookies using
config.action_dispatch.use_cookies_with_metadata = false
if you want your cookies to be readable on older versions of Rails.
|
|\ \
| | |
| | | |
`bundle binstubs bundler` should be executed after `bundle install`
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Fixes:
`bundle binstubs bundler` doesn't generate `bin/bundle` for newly
generated Rails app.
```
...
(snip)
run bundle binstubs bundler
The git source https://github.com/rails/web-console.git is not yet checked out.
Please run `bundle install` before trying to start your application
run bundle install
Fetching https://github.com/rails/web-console.git
(snip)
...
```
Related to #33202
|
|/ / |
|
|\ \
| |/
|/| |
Bundler binstubs
|
| | |
|
| |
| |
| |
| |
| | |
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
|
|\ \
| | |
| | | |
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
|
|\ \ \
| | | |
| | | |
| | | |
| | | | |
albertoalmagro/albertoalmagro/prefer-rails-command-over-bin-rails
Prefer rails command over bin/rails
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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.
|
| |/ /
|/| |
| | |
| | |
| | | |
http links will be redirected to the https version, but still better to
just directly link to the https version.
|
|\ \ \
| |/ /
|/| | |
Separate min and max threads count environment variable for puma configuration
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Same environment variable RAILS_MAX_THREADS was being used
for setting the minimum and maximum thread count for puma.
This change makes it obvious and easy to decide which
environment variable to change for setting the min or max.
Don't feel like this is a breaking change as the same
default is maintained.
|
| | |
| | |
| | |
| | |
| | | |
This TODO comment has been here more than 7 years and doesn't seem to be
a temporary implementation anymore.
|
|\ \ \
| |_|/
|/| |
| | |
| | | |
yhirano55/fix-app-update-when-hyphenated-name-is-given
Fix app:update when hyphenated name is given
|
| | |
| | |
| | |
| | |
| | |
| | | |
* Fixed app_name's difference between `rails new` and `app:update`
* Changed be prefer to const name than directory name.
* Kept original app name which use exception message.
|
| | |
| | |
| | |
| | | |
[Jon Moss & Xavier Noria]
|
| |/
|/|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Since #30016 Rails generates `.ruby-version` file
in order to help Ruby version manager tools like `rbenv`, `rvm`
determine which Ruby version should be used for the current Rails
project.
Since #32649 Rails sets Ruby version to the file compatible with MRI/JRuby
by default.
Pull Request #31496 reports that `.ruby-version` doesn't match ruby version other
than stable version and recommends to use `ENV["RBENV_VERSION"]`, and
`ENV["rvm_ruby_string"]` in order to set correct Ruby version to the file
that `rbenv` or `rvm` can understand.
Also, there is another similar issue that reports the same case if use
JRuby https://github.com/jruby/jruby/issues/5144.
Closes #31496, https://github.com/jruby/jruby/issues/5144.
|
|\ \
| | |
| | |
| | | |
Minimize Spring.watch calls
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | | |
In #32780, We have supported the `--skip-sprockets` option in the `app:update` task.
When `options[:api]` is truthy, `option[:skip_sprockets]` is also truthy. So we can remove this `remove_file` method.
https://github.com/rails/rails/blob/42b9e7e50c084e119a679cf155b70b5efc4d36ff/railties/lib/rails/generators/rails/app/app_generator.rb#L281-L283
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Execute `rails new myapp -S` and then upgrade the app by using the `app:update` task, `bin/rails c` results in `NoMethodError`.
```
$ bin/rails app:update
$ bin/rails c
Traceback (most recent call last):
44: from bin/rails:4:in `<main>'
(snip)
1: from /Users/tanimichi.tsukuru/ghq/github.com/moneyforward/moneyplus/config/initializers/assets.rb:4:in `<top (required)>'
/Users/tanimichi.tsukuru/ghq/github.com/moneyforward/moneyplus/vendor/bundle/ruby/2.5.0/gems/railties-5.2.0/lib/rails/railtie/configuration.rb:97:in `method_missing': undefined method `assets' for #<Rails::Application::Configuration:0x00007fcb8d3697e0> (NoMethodError)
Did you mean? asset_host
```
|
|\ \ \
| |_|/
|/| | |
Use ImageProcessing gem for ActiveStorage variants
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
ImageProcessing gem is a wrapper around MiniMagick and ruby-vips, and
implements an interface for common image resizing and processing. This
is the canonical image processing gem recommended in [Shrine], and
that's where it developed from. The initial implementation was extracted
from Refile, which also implements on-the-fly transformations.
Some features that ImageProcessing gem adds on top of MiniMagick:
* resizing macros
- #resize_to_limit
- #resize_to_fit
- #resize_to_fill
- #resize_and_pad
* automatic orientation
* automatic thumbnail sharpening
* avoids the complex and inefficient MiniMagick::Image class
* will use "magick" instead of "convert" on ImageMagick 7
However, the biggest feature of the ImageProcessing gem is that it has
an alternative implementation that uses libvips. Libvips is an
alternative to ImageMagick that can process images very rapidly (we've
seen up 10x faster than ImageMagick).
What's great is that the ImageProcessing gem provides the same interface
for both implementations. The macros are named the same, and the libvips
implementation does auto orientation and thumbnail sharpening as well;
only the operations/options specific to ImageMagick/libvips differ. The
integration provided by this PR should work for both implementations.
The plan is to introduce the ImageProcessing backend in Rails 6.0 as the
default backend and deprecate the MiniMagick backend, then in Rails 6.1
remove the MiniMagick backend.
|
|\ \ \
| | | |
| | | | |
Gracefully handle extra "controller" when generating controller
|
| | | | |
|
| | | |
| | | |
| | | |
| | | | |
In the previous code incorrectly removes intermediate words.
|
| | | | |
|
| | | | |
|
| | | | |
|
| |/ /
|/| |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This change may only apply to POSIX-compliant systems.
Previously:
$ ls -l config/master.key
-rw-r--r-- 1 owner group 32 Jan 1 00:00 master.key
Now:
$ ls -l config/master.key
-rw------- 1 owner group 32 Jan 1 00:00 master.key
|
| | |
| | |
| | | |
Fixes https://github.com/rails/rails/issues/32546 by including the `.keep` file in the .gitignore, bringing the `storage` folder in line with the `tmp` and `log` folders.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
There's no reason to block future versions of Capybara since we don't
_know_ they are going to break. How will we know if we have a
conservative option set? This change prevents us from blocking users who
want to upgrade in the future.
|