aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib
Commit message (Collapse)AuthorAgeFilesLines
* Add bootsnap to default Gemfile:Burke Libbey2017-07-172-0/+4
| | | | | | Bootsnap precomputes load path resolution and caches ruby ISeq and YAML parsing/compilation, reducing application boot time by approximately 50% on supported configurations.
* Set `RAILS_ENV` before load application fileyuuji.yaginuma2017-07-171-1/+4
| | | | | | | Since #29725, load application file when `dbconsole` command is executed. However, if do not set `RAILS_ENV` before reading the application file, can not connect to the env specified in option, so added the setting of `RAILS_ENV`.
* Merge pull request #29782 from y-yagi/follow_up_29699Kasper Timm Hansen2017-07-161-1/+1
|\ | | | | Set `represent_boolean_as_integer` via `configuration`
| * Set `represent_boolean_as_integer` via `configuration`yuuji.yaginuma2017-07-161-1/+1
| |
* | Merge pull request #29358 from robin850/dbconsole-connectionKasper Timm Hansen2017-07-163-8/+25
|\ \ | | | | | | Allow to pass a connection to the `dbconsole` command
| * | Properly expand the environment's nameRobin Dupret2017-07-163-7/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | Running the `console` and `dbconsole` commands with a regular argument as the environment's name automatically expand it to match an existing environment (e.g. dev for development). This feature wasn't available using the `--environment` (a.k.a `-e`) option.
| * | Deprecate environment as an argument for dbconsole and consoleRobin Dupret2017-07-161-0/+6
| | | | | | | | | | | | | | | | | | People should rather rely on the `-e` or `--environment` options to specify in which environment they want to work. This will allow us to specify the connection to pick as a regular argument in the future.
| * | Allow to pass a connection to the `dbconsole` commandRobin Dupret2017-07-161-2/+14
| |/ | | | | | | | | | | | | | | | | | | | | Since 0a4f6009, it's possible to specify a 3-level database configuration to gather connections by environment. The `dbconsole` command will try to look for a database configuration which points to the current environment but with such flavour, the environment key is flushed out so let's add the ability to specify the connection and pick `primary` by default to be consistent with Active Record.
* / Fix root not being defined on Travis.Kasper Timm Hansen2017-07-161-1/+6
|/
* Merge pull request #29645 from y-yagi/check_component_when_run_app_updateKasper Timm Hansen2017-07-163-23/+37
|\ | | | | Do not generate unused components contents in `app:update` task
| * Do not generate unused components contents in `app:update` taskyuuji.yaginuma2017-07-163-23/+37
| | | | | | | | | | | | | | | | | | | | | | | | Currently, `app:update` generates all contents regardless of the component using in application. For example, even if not using Action Cable, `app:update` will generate a contents related to Action Cable. This is a little inconvenient. This PR checks the existence of the component and does not generate unnecessary contents. Can not check all options in this way. However, it will be able to prevent the generation of unnecessary files.
* | Remove blank lines in setupYoshiyuki Hirano2017-07-161-2/+3
|/
* Allow to edit secrets in mutiple apps at the same timeyuuji.yaginuma2017-07-131-1/+2
| | | | | | | | | | | In encrypted secrets, the tmp file is used as a fixed file (`secrets.yml.enc` under the tmp directory). And that tmp file will be removed after process. Therefore, if edit secrets at the same time with multiple applications, the tmp file was conflicting. In order to avoid the above issue, added pid to tmp file.
* Change sqlite3 boolean serialization to use 1 and 0Lisa Ugray2017-07-112-0/+8
| | | | | | | | | | | | | | | | | | | | Abstract boolean serialization has been using 't' and 'f', with MySQL overriding that to use 1 and 0. This has the advantage that SQLite natively recognizes 1 and 0 as true and false, but does not natively recognize 't' and 'f'. This change in serialization requires a migration of stored boolean data for SQLite databases, so it's implemented behind a configuration flag whose default false value is deprecated. The flag itself can be deprecated in a future version of Rails. While loaded models will give the correct result for boolean columns without migrating old data, where() clauses will interact incorrectly with old data. While working in this area, also change the abstract adapter to use `"TRUE"` and `"FALSE"` as quoted values and `true` and `false` for unquoted. These are supported by PostreSQL, and MySQL remains overriden.
* Fix typo in method nameyuuji.yaginuma2017-07-111-1/+1
|
* Merge pull request #29742 from lugray/default_protect_from_forgeryRafael França2017-07-103-3/+8
|\ | | | | Default protect from forgery
| * Protect from forgery by defaultLisa Ugray2017-07-103-3/+8
| | | | | | | | | | | | | | | | Rather than protecting from forgery in the generated ApplicationController, add it to ActionController::Base by config. This configuration defaults to false to support older versions which have removed it from their ApplicationController, but is set to true for Rails 5.2.
* | * Don't eagerly require Rails' minitest plugin.Kasper Timm Hansen2017-07-109-262/+228
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | By making the Rails minitest behave like a standard minitest plugin we're much more likely to not break when people use other minitest plugins. Like minitest-focus and pride. To do this, we need to behave like minitest: require files up front and then perform the plugin behavior via the at_exit hook. This also saves us a fair bit of wrangling with test file loading. Finally, since the environment and warnings options have to be applied as early as possible, and since minitest loads plugins at_exit, they have to be moved to the test command. * Don't expect the root method. It's likely this worked because we eagerly loaded the Rails minitest plugin and that somehow defined a root method on `Rails`. * Assign a backtrace to failed exceptions. Otherwise Minitest pukes when attempting to filter the backtrace (which Rails' backtrace cleaner then removes). Means the exception message test has to be revised too. This is likely caused by the rails minitest plugin now being loaded for these tests and assigning a default backtrace cleaner.
* Merge pull request #29721 from y-yagi/fix_29696Kasper Timm Hansen2017-07-091-2/+2
|\ | | | | Treat secrets as binary
| * Treat secrets as binaryyuuji.yaginuma2017-07-091-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Until Rails 5.1.1 secrets was treated as binary inside Rails. https://github.com/rails/rails/blob/v5.1.1/railties/lib/rails/secrets.rb#L59 https://github.com/rails/rails/blob/v5.1.1/railties/lib/rails/secrets.rb#L63 However, it is treated as String in Rails 5.1.2(changed by 157db872103429e8782b62d1cb5d1d91337177a7). https://github.com/rails/rails/blob/v5.1.2/railties/lib/rails/secrets.rb#L104 https://github.com/rails/rails/blob/v5.1.2/railties/lib/rails/secrets.rb#L108 As a result, when upgrading from Rails 5.1.1 to 5.1.2, to write the value treated as binary using `File.write`, causing an error. In order to avoid `UndefinedConversionError`, fixed it to treat it as binary like 5.1.1. Fixes #29696
* | Load environment file in `dbconsole` commandyuuji.yaginuma2017-07-091-0/+1
|/ | | | | | | | | Currently the environment file is not loaded in `dbconsole` command. Therefore, for example, if use encrypted secrets values in database.yml, `read_encrypted_secrets` will not be true, so the value can not be used correctly. Fixes #29717
* Merge pull request #29695 from y-yagi/secrets_showMatthew Draper2017-07-091-0/+4
|\ | | | | Add `rails secrets:show` command
| * Add `rails secrets:show` commandyuuji.yaginuma2017-07-071-0/+4
| | | | | | | | | | | | | | | | | | | | | | When secrets confirmed with the `secrets:edit` command, `secrets.yml.enc` will change without updating the secrets. Therefore, even if only want to check secrets, the difference will come out. This is a little inconvenient. In order to solve this problem, added the `secrets:show` command. If just want to check secrets, no difference will occur use this command.
* | Do not update `secrets.yml.enc` when secretes do not changeyuuji.yaginuma2017-07-071-1/+3
|/ | | | | | | | | | | Currently, if open a file with `secrets:edit` command, `secrets.yml.enc` will be changed even if its contents do not change. Therefore, even if only want to check secrets, the difference will come out. This is a little inconvenient. As a fix to the above problem, when content does not change, `secrets.yml.ecn` is fixed so that it is not changed.
* Merge branch 'master' into require_relative_2017Xavier Noria2017-07-021-2/+9
|\
| * Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"Matthew Draper2017-07-02132-132/+0
| | | | | | | | | | This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
| * Merge pull request #29540 from kirs/rubocop-frozen-stringMatthew Draper2017-07-02132-0/+132
| |\ | | | | | | | | | Enforce frozen string in Rubocop
| | * Enforce frozen string in RubocopKir Shatrov2017-07-01132-0/+132
| | |
| * | Merge pull request #29534 from y-yagi/clear_screenshots_in_tmp_clear_taskEileen M. Uchitelle2017-07-011-2/+9
| |\ \ | | | | | | | | Clear screenshots files in `tmp:clear` task
| | * | Clear screenshots files in `tmp:clear` taskyuuji.yaginuma2017-06-271-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If system test fails, it creates screenshot under `tmp/screenshots`. https://github.com/rails/rails/blob/34fe2a4fc778d18b7fe6bdf3629c1481bee789b9/actionpack/lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb#L45 But currently, screenshot files is not cleared by `tmp:clear` task. This patch make clears screenshot files with `tmp:clear` task as well as other tmp files.
* | | | [Railties] require => require_relativeAkira Matsuda2017-07-0171-107/+107
|/ / /
* | | Merge pull request #29418 from dinahshi/scaffold_system_testsEileen M. Uchitelle2017-06-305-11/+68
|\ \ \ | |_|/ |/| | Add system tests to generate scaffold
| * | Add system tests to generate scaffoldDinah Shi2017-06-305-11/+68
| | |
* | | Ignore public/assetsamingilani2017-06-271-0/+4
| |/ |/|
* | Merge pull request #29560 from fatkodima/remove_unnecessary_tap_callRafael França2017-06-261-1/+1
|\ \ | | | | | | Remove unnecessary `tap` call on `ActionDispatch::MiddlewareStack.new`
| * | Remove unnecessary `tap` call on `ActionDispatch::MiddlewareStack` instancefatkodima2017-06-241-1/+1
| | |
* | | Add `railtie.rb` to the plugin generatorTsukuru Tanimichi2017-06-263-2/+14
|/ /
* | Deprecate an `capify!` method in generators and templatesyuuji.yaginuma2017-06-181-0/+1
| | | | | | | | | | | | | | | | | | The `capify` command has been removed by Capistrano 3 and became to `cap install`. Therefore, the `capify!` method has no meaning in Capistrano 3. I think that should deprecate. Ref: https://github.com/capistrano/capistrano/commit/492793916acf32ffe1604daec6fd4892c8935018
* | Add the `<app_root>/test` dir to the `$LOAD_PATH` as a string:Edouard CHIN2017-06-161-1/+1
| | | | | | | | - [Rails <= 5.0](https://github.com/rails/rails/blob/5-0-stable/railties/lib/rails/commands/test.rb#L6) used to add the `<app_root>/test` as a string; this behaviour changed in rails 5.1, it's appending a `Pathname` object
* | Use `require_relative` instead of `require` with full pathbogdanvlviv2017-06-142-2/+2
| |
* | Merge pull request #29289 from vergenzt/patch-1Vipul A M2017-06-121-0/+3
|\ \ | | | | | | Add note to Railtie docs to use unique filenames
| * | Add note to Railtie docs to use unique filenamesTim Vergenz2017-06-121-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | The fact that the names need to be globally unique was not obvious to me, so I thought it'd be worth documenting. This not being clear was the cause of both ctran/annotate_models#468 and instructure/outrigger#1. [ci skip]
* | | Merge pull request #29425 from gsamokovarov/drop-the-irb-termGuillermo Iguaran2017-06-121-1/+1
|\ \ \ | | | | | | | | Drop IRB out of the web-console Gemfile comment
| * | | Drop IRB out of the web-console Gemfile commentGenadi Samokovarov2017-06-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We don't provide exactly the same experience as IRB does, so let's not advertize it like that. We can say that it's an interactive console, without further references. I have also followed byebug's comment and changed the calling `console` part. Hopefully, this can hint that the invocation is not view specific and you can use it like the debugger statement. [ci skip]
* | | | Merge pull request #29263 from assain/default_message_encryptor_to_gcmKasper Timm Hansen2017-06-112-0/+8
|\ \ \ \ | |/ / / |/| | | Default Message Encryptor Cipher to AES-256-GCM From AES-256-CBC
| * | | set message_encryptor default cipher to aes-256-gcmAssain2017-06-122-0/+8
| | | | | | | | | | | | | | | | - Introduce a method to select default cipher, and maintain backward compatibility
* | | | Access EDITOR through Ruby's cross-platform ENV.Kasper Timm Hansen2017-06-111-2/+2
| |_|/ |/| | | | | | | | | | | Fix the mistake of not using Ruby's ENV hash from the get go and get windows support.
* | | Ensure MSSQL password uses real ENV var.Ken Collins2017-06-051-2/+2
|/ /
* | Use mattr_accessor default: option throughout the projectGenadi Samokovarov2017-06-032-3/+4
| |
* | Make Rails welcome page responsiveLucas Caton2017-06-031-4/+14
| |