aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* | | use "minitest" consistentlyXavier Noria2018-09-112-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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 for MySQL database (#33608)Yasuo Honda2018-09-111-1/+1
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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/
* | Use canonical name for block localyuuji.yaginuma2018-09-071-12/+12
| | | | | | | | | | | | | | | | `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.
* | Generate a gem that can't be pushed to Rubygems.org by defaultRafael Mendonça França2018-09-061-0/+9
| | | | | | | | | | This will avoid gems that are made to be private to be pushed to public repositories.
* | Respect config setting when output deprecation notice in rake tasksyuuji.yaginuma2018-09-043-5/+5
| | | | | | | | | | | | | | | | | | The rake tasks which became deprecate now does not load the environment. Therefore, even if the application specifies the behavior of deprecating, the message is output to stderr ignoring the specification. It seems that this is not the expected behavior. We should respect the setting even in the rake tasks.
* | Merge pull request #33773 from mcnelson/null_cache_store_for_test_envGeorge Claghorn2018-09-021-0/+1
|\ \ | | | | | | Make null_store the default cache store in test environment config
| * | Set cache store as null_store for test environmentMichael Nelson2018-08-021-0/+1
| | |
* | | Merge pull request #33743 from ↵Rafael França2018-08-311-15/+41
|\ \ \ | | | | | | | | | | | | | | | | steakknife/steakknife/improve-template-generator-actions add github to template actions, template actions minor refactor
| * | | add github to template actions, light DSL refactorBarry Allard2018-08-301-15/+41
| | | |
* | | | Emit warning for unknown inflection rule when generating model.Yoshiyuki Kinjo2018-08-311-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | Merge pull request #33748 from eileencodes/fix-erb-loading-issue-with-db-yamlEileen M. Uchitelle2018-08-291-12/+0
|\ \ \ \ | |/ / / |/| | | Drop load_database_yaml and fix test
| * | | Drop load_database_yaml and fix testEileen Uchitelle2018-08-291-12/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We originally did the whole `load_database_yaml` thing because this test wasn't cooperating and we needed to finish the namespaced rake tasks for multiple databases. However, it turns out that YAML can't eval ERB if you don't tell it it's ERB so you get Pysch parse errors if you're using multi-line ERB or ERB with conditionals. It's a hot mess. After trying a few things and thinking it over we decided that it wasn't worth bandaiding over, the test needed to be improved. The test was added in #31135 to test that the env is loaded in these tasks. But it was blowing up because we were trying to read a database name out of the configuration - however that's not the purpose of this change. We want to read environment files in the rake tasks, but not in the config file. In this PR we changed the test to test what the PR was actually fixing. We've also deleted the `load_database_yaml` because it caused more problems than it was worth. This should fix the issues described in https://github.com/rails/rails/pull/32274#issuecomment-384161057. We also had these problems at GitHub. Co-authored-by: alimi <aibrahim2k2@gmail.com>
* | | | Generate the same value as a label of view in system test templateyuuji.yaginuma2018-08-291-2/+2
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Merge pull request #33703 from bogdanvlviv/follow-up-33659George Claghorn2018-08-231-1/+1
|\ \ \ | | | | | | | | Follow up #33659
| * | | Set the test adapter for the test environment by default in `config/cable.yml`bogdanvlviv2018-08-231-1/+1
| | | |
* | | | Merge pull request #33696 from bogdanvlviv/follow-up-44007c070Kasper Timm Hansen2018-08-234-10/+10
|\ \ \ \ | |/ / / |/| | | Use `say`/`error` instead of `puts`/`$stderr.puts`
| * | | Use `say`/`error` instead of `puts`/`$stderr.puts`bogdanvlviv2018-08-224-10/+10
| | | | | | | | | | | | | | | | Follow up 44007c07098a3c633180881cae9285da4622e63f
* | | | Merge pull request #33697 from bogdanvlviv/rails-command-help-show-descriptionRafael França2018-08-222-2/+5
|\ \ \ \ | | | | | | | | | | Fix `rails initializers --help` and `rails dev:cache --help`
| * | | | Fix `rails initializers --help` and `rails dev:cache --help`bogdanvlviv2018-08-222-2/+5
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - `rails initializers --help` should show description set by `desc` See railties/lib/rails/command/base.rb:27 - Fix `rails dev:cache --help` ``` Traceback (most recent call last): 10: from bin/rails:4:in `<main>' 9: from bin/rails:4:in `require' 8: from /work/rails/railties/lib/rails/commands.rb:18:in `<top (required)>' 7: from /work/rails/railties/lib/rails/command.rb:46:in `invoke' 6: from /work/rails/railties/lib/rails/command/base.rb:65:in `perform' 5: from /home/vagrant/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/thor-0.20.0/lib/thor.rb:387:in `dispatch' 4: from /home/vagrant/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/thor-0.20.0/lib/thor/invocation.rb:126:in `invoke_command' 3: from /home/vagrant/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/thor-0.20.0/lib/thor/command.rb:27:in `run' 2: from /work/rails/railties/lib/rails/command/base.rb:150:in `help' 1: from /home/vagrant/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/thor-0.20.0/lib/thor.rb:170:in `command_help' /home/vagrant/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/thor-0.20.0/lib/thor/base.rb:497:in `handle_no_command_error': Could not find command "dev". (Thor::UndefinedCommandError) ``` Context https://github.com/rails/rails/pull/33694#issuecomment-415127304 Would be great to set a description to other commands.
* / / / Remove `rake initializers` from rake tasks listbogdanvlviv2018-08-221-1/+0
|/ / / | | | | | | | | | Context https://github.com/rails/rails/pull/33631#discussion_r210732565
* | | Make `rake routes` deprecate before deletingyuuji.yaginuma2018-08-202-0/+10
| | | | | | | | | | | | | | | | | | | | | `rake routes` was a public task. Therefore, I think that we should deprecate it before deleting it. Related to #32121.
* | | Don't put up with not saying it.Kasper Timm Hansen2018-08-191-1/+1
| | | | | | | | | | | | Commands generally prefer say to puts.
* | | Merge pull request #33631 from anniecodes/initializers-commandKasper Timm Hansen2018-08-192-4/+22
|\ \ \ | | | | | | | | Move the initializers rake task to Rails::Command
| * | | Update 'rake initializers' to use Rails::Command under the hoodAnnie-Claude Côté2018-08-161-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | * Invoke Rails::Command within the rake task * Adds test for calling initializers with 'bin/rake' * Adds deprecation warning to the rake task
| * | | Move 'rails initializers' command to Rails::CommandAnnie-Claude Côté2018-08-161-0/+16
| | | |
* | | | Enable Style/ParenthesesAroundCondition copRyuta Kamizono2018-08-191-2/+2
|/ / / | | | | | | | | | To prevent style check in review like https://github.com/rails/rails/pull/33608#discussion_r211087605.
* | | Do not show deprecate task in the task listyuuji.yaginuma2018-08-161-1/+0
| | |
* | | Merge pull request #33499 from lsylvester/caller-ignore-pathsKasper Timm Hansen2018-08-151-12/+0
|\ \ \ | | | | | | | | use BacktraceCleaner for ActiveRecord verbose logging
| * | | Use backtrace cleaner to clean up backtrace for verbose query logsLachlan Sylvester2018-08-141-12/+0
| | | |
* | | | Merge pull request #33559 from anniecodes/dev-taskKasper Timm Hansen2018-08-152-2/+18
|\ \ \ \ | | | | | | | | | | Move `dev:cache` rake task to use Rails::Command
| * | | | Have `bin:rake dev:cache` use the Dev Rails Command under the hoodAnnie-Claude Côté2018-08-131-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | * Call the Rails::Command::DevCommand in the rake task for dev:cache * Add deprecation for using `bin/rake` in favor of `bin/rails`
| * | | | Adds Rails:Command for `dev:cache` that has the same behaviour as the rake taskAnnie-Claude Côté2018-08-131-0/+14
| |/ / /
* / / / Use `Array#extract!` where possiblebogdanvlviv2018-08-141-1/+2
|/ / /
* | | Purpose Metadata For Signed And Encrypted CookiesAssain2018-08-123-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Merge pull request #33587 from bogdanvlviv/follow-up-33202Kasper Timm Hansen2018-08-111-3/+2
|\ \ \ | | | | | | | | `bundle binstubs bundler` should be executed after `bundle install`
| * | | `bundle binstubs bundler` should be executed after `bundle install`bogdanvlviv2018-08-111-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | Make active job name prefix static since Rails.env will always be the sameVinicius Stock2018-08-111-1/+1
|/ / /
* | | Merge pull request #33202 from deivid-rodriguez/bundler_binstubsEileen M. Uchitelle2018-08-113-2/+8
|\ \ \ | | | | | | | | Bundler binstubs
| * | | Generate bundler-compatible bundler binstubDavid Rodríguez2018-06-233-2/+8
| | | |
* | | | Fix the obvious typos detected by github.com/client9/misspellKazuhiro Sera2018-08-081-1/+1
| | | |
* | | | update BacktraceCleaner::RENDER_TEMPLATE_PATTERN to match the ↵Lachlan Sylvester2018-08-071-1/+1
| |/ / |/| | | | | | | | ActionView::Template method names
* | | Log the remote IP addr of clients behind a proxyAtul Bhosale2018-07-311-1/+1
| |/ |/| | | | | [Atul Bhosale, Victor Nawothnig]
* | Enable Start/EndWith and RegexpMatch copsBart de Water2018-07-287-9/+9
| | | | | | | | | | 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
* | Merge pull request #32381 from q-centrix/update-codeclimate-configsRichard Schneeman2018-07-255-18/+6
|\ \ | | | | | | Turn on performance based cops
| * | Turn on performance based copsDillon Welch2018-07-235-18/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Merge pull request #33229 from ↵Matthew Draper2018-07-2511-18/+18
|\ \ \ | | | | | | | | | | | | | | | | albertoalmagro/albertoalmagro/prefer-rails-command-over-bin-rails Prefer rails command over bin/rails
| * | | Show rails instead of bin/rails on USAGE instructionsAlberto Almagro2018-07-062-2/+2
| | | | | | | | | | | | | | | | | | | | With this commit, rails commands usage instructions display now +rails+ instead of +bin/rails+ within their recommendations.
| * | | Recommend use of rails over bin/railsAlberto Almagro2018-07-069-16/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 httpsPaul McMahon2018-07-2412-13/+13
| |/ / |/| | | | | | | | | | | http links will be redirected to the https version, but still better to just directly link to the https version.
* | | Merge pull request #32984 from chiraggshah/min-thread-env-variableRichard Schneeman2018-07-211-2/+3
|\ \ \ | | | | | | | | Separate min and max threads count environment variable for puma configuration