aboutsummaryrefslogtreecommitdiffstats
path: root/railties
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | | | Fix duplicated suffix for JobGeneratorYoshiyuki Hirano2018-04-222-0/+15
| | |/ / / | |/| | |
* / | | | Add test case to ChannelGeneratorTestYoshiyuki Hirano2018-04-221-0/+10
|/ / / / | | | | | | | | | | | | * Add a test case to ensure avoid duplicated suffix in channel generator
* | | | Don't include bootsnap by default in apps generated under JRubyGuillermo Iguaran2018-04-202-4/+13
| | | |
* | | | [ci skip] Prefix class name with Rails:: in docsAlberto Almagro2018-04-201-3/+3
| | | | | | | | | | | | | | | | | | | | After renaming and deprecation of SourceAnnotationExtractor documentation has been updated to reflect the new name Rails::SourceAnnotationExtractor
* | | | [ci skip] Improve #find_in documentation.Alberto Almagro2018-04-201-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous documentation version listed only the default registered extensions. This was misleading because if more extensions get registered with <tt>SourceAnnotationExtractor::Annotation.register_extensions</tt>, they would be also taken into account. By saying that we consider all registered extensions we document what happens in reality.
* | | | Fix typo on method nameAlberto Almagro2018-04-201-1/+1
| | | |
* | | | Create a .ruby-version compatible with MRI/JRuby by defaultGuillermo Iguaran2018-04-192-2/+2
| | | |
* | | | [ci skip] Restore of links in RDOC_MAIN after an update of the file (#32644)Felipe Tovar2018-04-191-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * [ci skip] Update links in RDOC_MAIN and remove style of word rails in README * [ci skip] Update links in RDOC_MAIN and remove style of word rails in README [Felipe Tovar & Rafael Mendonça França]
* | | | Merge pull request #32605 from composerinteralia/assert-notRafael França2018-04-1913-37/+37
|\ \ \ \ | | | | | | | | | | Add RuboCop for `assert_not` over `assert !`
| * | | | Replace `assert !` with `assert_not`Daniel Colson2018-04-1913-37/+37
| | | | | | | | | | | | | | | | | | | | | | | | | This autocorrects the violations after adding a custom cop in 3305c78dcd.
* | | | | Merge pull request #32626 from ftovaro/masterXavier Noria2018-04-191-22/+29
|\ \ \ \ \ | | | | | | | | | | | | [ci skip] Update README and RDOC_MAIN
| * | | | | [ci skip] Remove style of the word Rails at the topFelipe Tovar2018-04-191-1/+1
| | | | | |
| * | | | | [ci skip] update RDOC_MAINFelipe Tovar2018-04-191-23/+30
| |/ / / /
* / / / / Make the master.key readable only by the ownerJose Luis Duran2018-04-193-0/+27
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | Fix test to allow IF NOT EXISTS in structure:dumputilum2018-04-161-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before: ``` $ ruby -v ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux] $ ruby -w -Itest -Ilib -I../activesupport/lib -I../actionpack/lib -I../actionview/lib -I../activemodel/lib test/application/rake/multi_dbs_test.rb Run options: --seed 28744 F Failure: ApplicationTests::RakeTests::RakeMultiDbsTest#test_db:migrate_and_db:structure:dump_and_db:structure:load_works_on_all_databases [test/application/rake/multi_dbs_test.rb:70]: Expected /CREATE TABLE \"books\"/ to match "CREATE TABLE IF NOT EXISTS \"schema_migrations\" (\"version\" varchar NOT NULL PRIMARY KEY);\nCREATE TABLE IF NOT EXISTS \"ar_internal_metadata\" (\"key\" varchar NOT NULL PRIMARY KEY, \"value\" varchar, \"created_at\" datetime NOT NULL, \"updated_at\" datetime NOT NULL);\nCREATE TABLE IF NOT EXISTS \"books\" (\"id\" integer PRIMARY KEY AUTOINCREMENT NOT NULL, \"title\" varchar, \"created_at\" datetime NOT NULL, \"updated_at\" datetime NOT NULL);\nCREATE TABLE sqlite_sequence(name,seq);\nINSERT INTO \"schema_migrations\" (version) VALUES\n('20180416201805');\n\n\n". ```
* | | | Deprecate support for using `HOST` environment to specify server IP (#32540)Yuji Yaginuma2018-04-163-3/+35
| |/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At SuSE, `$HOST` is set by default and is equal to `$HOSTNAME`. https://www.suse.com/documentation/sled11/book_sle_admin/data/sec_adm_variables.html Therefore, by default, it binds to hostname instead of `localhost`. This seems not to be appropriate as default behavior. In order to avoid the name of the environment variable being used, I changed the environment variable from `HOST` to `BINDING`. Fixes #29516.
* | | Add .keep exception for storage folderPaul2018-04-131-1/+4
| | | | | | | | | 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.
* | | Allow use of minitest-rails gem with Rails test runneryuuji.yaginuma2018-04-111-1/+1
| | | | | | | | | | | | | | | | | | | | | Add explicit global namespace to `Rails::TestUnit::Runner` to resolve a namespace conflict between `minitest-rails` and Rails test runner. Fixes #31324
* | | Remove upper bound on Capybaraeileencodes2018-04-101-1/+1
| | | | | | | | | | | | | | | | | | | | | 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.
* | | Add multidb application testeileencodes2018-04-092-16/+215
| | | | | | | | | | | | | | | | | | | | | | | | | | | I realized I wasn't really testing some of the new rake tasks added so I built out this new test that uses a multi-db database.yml and allows us to run create/drop/migrate/schema:dump/schema:load and those that are namespaced like create:animals. This will make our testing more robust so we can catch problems quicker and set a good place to add future tests as these features evolve.
* | | rewords a bit RDOC_MAIN.rdoc [ci skip]Yoshiyuki Hirano2018-04-081-2/+2
| | | | | | | | | | | | * Same change as bba832d
* | | Fix test added in #32444bogdanvlviv2018-04-061-2/+4
| | | | | | | | | | | | | | | | | | | | | Currently test `#test_logger_does_not_mutate_app_return` doesn't test mutation of response and the test passes with and without changes added in #32444. `#freeze` response in the test in order to test mutation.
* | | Merge pull request #32441 from composerinteralia/refute-notRafael França2018-04-041-1/+1
|\ \ \ | | | | | | | | Add custom RuboCop for `assert_not` over `refute`
| * | | Autocorrect `refute` RuboCop violationsDaniel Colson2018-04-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | 73e7aab behaved as expected on codeship, failing the build with exactly these RuboCop violations. Hopefully `rubocop -a` will have been enough to get a passing build!
* | | | Merge pull request #32444 from matrinox/fix-return-response-mutation-rack-loggerRafael Mendonça França2018-04-042-5/+21
|\ \ \ \ | | | | | | | | | | | | | | | Stop mutating body response
| * | | | Stop mutating body responseGeoff Lee2018-04-032-5/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If @app.call returns an object that is saved (for e.g., in a constant), the mutation results in a continuing cycle of wrapping the body in Rack::BodyProxy, eventually leading to SystemStackError ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ On branch fix-return-response-mutation-rack-logger - Tue 3 Apr 2018 19:54:28 PDT by Geoff Lee <geoff.lee@lendesk.com>
* | | | | Merge pull request #32435 from ↵Eileen M. Uchitelle2018-04-043-7/+7
|\ \ \ \ \ | |/ / / / |/| | | | | | | | | | | | | | bogdanvlviv/add-missing-dots-at-the-end-of-comments Add missing dots at the end of comments in environment file templates
| * | | | Add missing dots at the end of comments in environment file templatesbogdanvlviv2018-04-033-7/+7
| | | | | | | | | | | | | | | | | | | | Add dots in order to keep consistency between other comments in these files.
* | | | | Fix RenderingTest in railtieYoshiyuki Hirano2018-04-041-1/+1
|/ / / / | | | | | | | | | | | | Test class name is not `RoutingTest` but `RenderingTest`
* | | | Add `action_view.finalize_compiled_template_methods` config optionSimon Coffey2018-04-021-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ActionView::Template instances compile their source to methods on the ActionView::CompiledTemplates module. To prevent leaks in development mode, where templates can frequently change, a finalizer is added that undefines these methods[1] when the templates are garbage-collected. This is undesirable in the test environment, however, as templates don't change during the life of the test. Moreover, the cost of undefining a method is proportional to the number of descendants a class or module has, since the method cache must be cleared for all descendant classes. As ActionView::CompiledTemplates is mixed into every ActionView::TestCase (or in RSpec suites, every view spec example group), it can end up with a very large number of descendants, and undefining its methods can become very expensive. In large test suites, this results in a long delay at the end of the test suite as all template finalizers are run, only for the process to then exit. To avoid this unnecessary cost, this change adds a config option, `action_view.finalize_compiled_template_methods`, defaulting to true, and sets it to false in the test environment only. [1] https://github.com/rails/rails/blob/09b2348f7fc8d4e7191e70e06608c5909067e2aa/actionview/lib/action_view/template.rb#L118-L126
* | | | Merge pull request #32065 from ↵Kasper Timm Hansen2018-04-025-123/+132
|\ \ \ \ | |/ / / |/| | | | | | | | | | | sikachu/move-SourceAnnotationExtractor-under-rails-namespec Move SourceAnnotationExtractor under Rails module
| * | | Add deprecation note for SourceAnnotationExtractorPrem Sichanugrist2018-03-221-0/+7
| | | |
| * | | Make Annotation into a proper classPrem Sichanugrist2018-03-221-1/+1
| | | | | | | | | | | | | | | | | | | | This cleans up the documentation for SourceAnnotationExtractor because RDoc does not seems to know how to parse `Struct.new() do` block.
| * | | Move SourceAnnotationExtractor under Rails modulePrem Sichanugrist2018-03-225-123/+125
| |/ / | | | | | | | | | This class should be under Rails module as it belongs to Rails.
* | | Deriving `secret_key_base` breaks `key_generator` defined in 5.1.Yoshiyuki Kinjo2018-03-312-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If one created Rails 5.1 app and then updated to 5.2, `secret_key_base` defined in `config/secrets.yml` is ignored for `development` and `test` environment. A change in `secret_key_base` in turn breaks `Rails.application.key_generator`. If one encrypt data in Rails 5.1, she cannot decrypt it in Rails 5.2 for `development` and `test` environment.
* | | Remove unnecessary line break and quotesyuuji.yaginuma2018-03-301-2/+2
| | |
* | | Fix "--frozen-lockfile" argument used in yarn install rake taskGuillermo Iguaran2018-03-291-1/+1
| | | | | | | | | --frozen-lockfile is the right name of the argument
* | | Merge pull request #32289 from gsamokovarov/did-you-mean-suggestionsGuillermo Iguaran2018-03-296-57/+14
|\ \ \ | | | | | | | | Use `did_you_mean` spell checker for option suggestions
| * | | Use `did_you_mean` spell checker for option suggestionsGenadi Samokovarov2018-03-236-57/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that we require Ruby over `2.3`, we can replace the current suggestion methods we have with tooling from the `did_you_mean` gem. There is a small user visible change and this is that we now offer a single suggestion for misspelled options. We are suggesting fixes during generator invocation and during a mistyped rails server rack handler. In both cases, if we don't make a proper prediction on the first match, we won't do so in the second or third one, so in my mind, this is okay.
* | | | Merge pull request #32243 from maschwenk/patch-2Guillermo Iguaran2018-03-291-1/+1
|\ \ \ \ | | | | | | | | | | [Webpack] Raise an error when lockfile diff is generated
| * | | | Raise an error when lockfile diff is generatedMax Schwenk2018-03-131-1/+1
| | | | | | | | | | | | | | | https://yarnpkg.com/en/docs/cli/install#toc-yarn-install-frozen-lockfile
* | | | | Compare ruby version with correct wayShia2018-03-291-1/+1
| | | | |
* | | | | Merge pull request #32274 from eileencodes/part-1-add-rake-tasks-for-multi-dbEileen M. Uchitelle2018-03-261-0/+12
|\ \ \ \ \ | |_|_|/ / |/| | | | Part 1 Easy Multi db in Rails: Add basic rake tasks for multi db setup
| * | | | Refactor configs_for and friendseileencodes2018-03-211-0/+12
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Moves the configs_for and DatabaseConfig struct into it's own file. I was considering doing this in a future refactoring but our set up forced me to move it now. You see there are `mattr_accessor`'s on the Core module that have default settings. For example the `schema_format` defaults to Ruby. So if I call `configs_for` or any methods in the Core module it will reset the `schema_format` to `:ruby`. By moving it to it's own class we can keep the logic contained and avoid this unfortunate issue. The second change here does a double loop over the yaml files. Bear with me... Our tests dictate that we need to load an environment before our rake tasks because we could have something in an environment that the database.yml depends on. There are side-effects to this and I think there's a deeper bug that needs to be fixed but that's for another issue. The gist of the problem is when I was creating the dynamic rake tasks if the yaml that that rake task is calling evaluates code (like erb) that calls the environment configs the code will blow up because the environment is not loaded yet. To avoid this issue we added a new method that simply loads the yaml and does not evaluate the erb or anything in it. We then use that yaml to create the task name. Inside the task name we can then call `load_config` and load the real config to actually call the code internal to the task. I admit, this is gross, but refactoring can't all be pretty all the time and I'm working hard with `@tenderlove` to refactor much more of this code to get to a better place re connection management and rake tasks.
* | | | Fix `test_config_another_database` failureRyuta Kamizono2018-03-221-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Somehow `test_config_another_database` didn't fail on CI, but it will fail locally. https://travis-ci.org/rails/rails/jobs/356212950#L2474-L2482 ``` % bundle exec ruby -w -Itest test/generators/app_generator_test.rb -n test_config_another_database Run options: -n test_config_another_database --seed 7260 # Running: F Failure: AppGeneratorTest#test_config_another_database [test/generators/app_generator_test.rb:417]: Expected /^\s*gem\s+["']mysql2["'], '~> 0.4.4'$*/ to match "source 'https://rubygems.org'\ngit_source(:github) { |repo| \"https://github.com/\#{repo}.git\" }\n\nruby '2.5.0'\n\n# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'\ngem 'rails', '~> 6.0.0.alpha'\n# Use mysql as the database for Active Record\ngem 'mysql2', '>= 0.4.4', '< 0.6.0'\n# Use Puma as the app server\ngem 'puma', '~> 3.11'\n# Use SCSS for stylesheets\ngem 'sass-rails', '~> 5.0'\n# Use Uglifier as compressor for JavaScript assets\ngem 'uglifier', '>= 1.3.0'\n# See https://github.com/rails/execjs#readme for more supported runtimes\n# gem 'mini_racer', platforms: :ruby\n\n# Use CoffeeScript for .coffee assets and views\ngem 'coffee-rails', '~> 4.2'\n# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks\ngem 'turbolinks', '~> 5'\n# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder\ngem 'jbuilder', '~> 2.5'\n# Use Redis adapter to run Action Cable in production\n# gem 'redis', '~> 4.0'\n# Use ActiveModel has_secure_password\n# gem 'bcrypt', '~> 3.1.7'\n\n# Use ActiveStorage variant\n# gem 'mini_magick', '~> 4.8'\n\n# Use Capistrano for deployment\n# gem 'capistrano-rails', group: :development\n\n# Reduces boot times through caching; required in config/boot.rb\ngem 'bootsnap', '>= 1.1.0', require: false\n\ngroup :development, :test do\n # Call 'byebug' anywhere in the code to stop execution and get a debugger console\n gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]\nend\n\ngroup :development do\n # Access an interactive console on exception pages or by calling 'console' anywhere in the code.\n gem 'web-console', '>= 3.3.0'\n gem 'listen', '>= 3.0.5', '< 3.2'\n # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring\n gem 'spring'\n gem 'spring-watcher-listen', '~> 2.0.0'\nend\n\ngroup :test do\n # Adds support for Capybara system testing and selenium driver\n gem 'capybara', '>= 2.15', '< 4.0'\n gem 'selenium-webdriver'\n # Easy installation and use of chromedriver to run system tests with Chrome\n gem 'chromedriver-helper'\nend\n\n# Windows does not include zoneinfo files, so bundle the tzinfo-data gem\ngem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]\n". bin/rails test test/generators/app_generator_test.rb:411 Finished in 0.174681s, 5.7247 runs/s, 34.3483 assertions/s. 1 runs, 6 assertions, 1 failures, 0 errors, 0 skips ```
* | | | Support mysql2 0.4.x and 0.5.xAaron Stone2018-03-201-1/+1
|/ / /
* | | Merge pull request #32271 from eileencodes/fix-three-tier-default-connectionEileen M. Uchitelle2018-03-161-1/+1
|\ \ \ | | | | | | | | Fix default connection handling with three-tier config
| * | | Switch dbconsole config loader checkeileencodes2018-03-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In a three-tier config environment `configurations[environment].presence` will return `{ :primary => { :key => value, :key => value }, :secondary => { :key => value, :key => value} }, which means it's not given a single config to connect to. If we flip these however it will connect to primary because that's the default connection, and on a two tier it will be `nil` so the code will select the connection from the configurations rather than the connection.
* | | | Pass the skip_pipeline option in image_submit_tagAndrew White2018-03-141-1/+2
| |/ / |/| | | | | | | | Fixes #32248.
* | | Rely on Rails::Command's help output.Kasper Timm Hansen2018-03-132-72/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We end up with: ``` Usage: bin/rails routes [options] Options: -c, [--controller=CONTROLLER] # Filter by a specific controller, e.g. PostsController or Admin::PostsController. -g, [--grep=GREP] # Grep routes by a specific pattern. -E, [--expanded], [--no-expanded] # Print routes expanded vertically with parts explained. ``` which does miss the bit about routes being printed in order. Also: * Renames options to ease help output readability, then clarifies each option. * Fixes a bunch of indentation.