aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Returns `nil` when `AM::Errors#delete` doesn't delete anything:Edouard CHIN2019-07-112-1/+7
| | | | | | | | | - `AM::Errors#delete` currently returns an empty array when trying to delete an error that doesn't exist. This behaviour is surprising and I think it would be better to no return a truthy value but instead return nil like `Hash#delete` does.
* Merge pull request #36617 from ↵Eileen M. Uchitelle2019-07-082-5/+24
|\ | | | | | | | | wjessop/fix_database_url_trampling_other_env_configs When DATABASE_URL is specified don't trample envs that use a url: key
| * When DATABASE_URL is specified don't trample envs that use a url: keyWill Jessop2019-07-082-5/+24
|/ | | | fixes #36610
* Merge pull request #36616 from kamipo/dont_use_alias_for_grouped_fieldRyuta Kamizono2019-07-082-1/+8
|\ | | | | Do not use aliases in GROUP BY clause
| * Do not use aliases in GROUP BY clauseRyuta Kamizono2019-07-082-1/+8
| | | | | | | | | | | | | | It appears that Oracle does not allow using aliases in GROUP BY clause unlike ORDER BY clause. Fixes #36613.
* | Implement ActiveStorage::Blob#attachable_plain_text_representationGeorge Claghorn2019-07-072-0/+9
| | | | | | | | | | | | Fixes that file attachments without captions would not be represented in plain text generated from rich-text content, causing ActionText::RichText#present? to return false. Closes #36607.
* | Should `Regexp.escape` quoted table name in regexRyuta Kamizono2019-07-087-115/+51
|/ | | | | It is for agnostic test case, since quoted table name may include `.` for all adapters, and `[` / `]` for sqlserver adapter.
* Merge pull request #36443 from jhawthorn/as_parallelization_process_nameJohn Hawthorn2019-07-061-0/+11
|\ | | | | Set process title of parallelized test workers
| * Set process name of parallelized test workersJohn Hawthorn2019-06-071-0/+11
| |
* | Merge pull request #36602 from jhawthorn/system_testing_preload_2John Hawthorn2019-07-063-4/+14
|\ \ | | | | | | Fix Browser#preload for older Selenium
| * | Bump minimum selenium-webdriver versionJohn Hawthorn2019-07-042-2/+2
| | | | | | | | | | | | Since #36424, we need an newer version in order to pass.
| * | Fix Browser#preload for older SeleniumJohn Hawthorn2019-07-041-2/+12
| | | | | | | | | | | | | | | | | | | | | Older versions of selenium had driver_path on ::Selenium::WebDriver::Chrome directly, not on Service. This avoids errors on those old versions and will preload properly if webdrivers is installed.
* | | Merge pull request #36604 from kamipo/fix_schema_dumping_enumRyuta Kamizono2019-07-076-7/+55
|\ \ \ | | | | | | | | MySQL: Fix schema dumping `enum` and `set` columns correctly
| * | | MySQL: Fix schema dumping `enum` and `set` columns correctlyRyuta Kamizono2019-07-056-7/+55
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | `enum` and `set` are typed cast as `:string`, but currently the `:string` type is incorrectly reused for schema dumping. A cast type on columns is not always the same with `sql_type`, this fixes schema dumping `enum` and `set` columns to use `sql_type` instead of `type` correctly.
* | | Merge pull request #36605 from jmondo/patch-3Ryuta Kamizono2019-07-061-1/+1
|\ \ \ | |/ / |/| | | | | | | | Update docs on dirty.rb [ci skip]
| * | Update docs on dirty.rbJohn Gesimondo2019-07-051-1/+1
|/ / | | | | `previously_changed` seems to actually be `previous_changes`
* | Merge pull request #36592 from jhawthorn/system_testing_preloadJohn Hawthorn2019-07-044-0/+29
|\ \ | | | | | | Preload browser driver_path to fix system testing under parallelism
| * | Preload browser driver_path for system testingJohn Hawthorn2019-07-034-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The webdrivers gem configures Selenium::WebDriver::Service.driver_path as a proc which updates the web drivers and returns their path. This commit introduces SystemTesting::Browser#preload, which runs this proc early. This ensures that webdrivers update is run before forking for parallel testing, but doesn't explicitly tie us to that gem (and I think anything configured as driver_path probably makes sense to eager-load).
* | | Fix a typo by removing extra article [ci skip]jacobherrington2019-07-041-1/+1
| | |
* | | Merge pull request #36594 from jacobherrington/doc/rephrase-ski-ci-instructionsPrem Sichanugrist2019-07-041-1/+1
|\ \ \ | |/ / |/| | Update docs regarding skipping CI tests [ci skip]
| * | Update docs regarding skipping CI tests [ci skip]jacobherrington2019-07-031-1/+1
|/ / | | | | | | | | | | The phrasing of this struck we as odd, "To help our CI servers..." So I feel it would be more useful if we explain more explicitly that ci skip cuts down on usage by not running CI.
* | Merge pull request #36585 from tr4b4nt/patch-1Eileen M. Uchitelle2019-07-031-1/+1
|\ \ | | | | | | Fix swapped replica/primary in multi-db docs [ci skip]
| * | Replace replica with primary in automatic connection switching after write ↵tr4b4nt2019-07-021-1/+1
| | | | | | | | | | | | | | | in multi-db docs [ci skip] Reads after write should be from the primary database.
* | | Merge pull request #36534 from y-yagi/fixes_35137Yuji Yaginuma2019-07-037-12/+120
|\ \ \ | |/ / |/| | Add the ability to set the CSP nonce only to the specified directives
| * | Add the ability to set the CSP nonce only to the specified directivesyuuji.yaginuma2019-06-227-12/+120
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I changed to set CSP nonce to `style-src` directive in #32932. But this causes an issue when `unsafe-inline` is specified to `style-src` (If a nonce is present, a nonce takes precedence over `unsafe-inline`). So, I fixed to nonce directives configurable. By configure this, users can make CSP as before. Fixes #35137.
* | | Revert "Merge pull request #36582 from f1337/master"Ryuta Kamizono2019-07-021-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 60e19c6d6cb60159af4e2247f29d2cea375a21d6, reversing changes made to 72e257b4c935b6829f7d4db36dea61a1682aa44e. The method signature is different between `create_file` and `template`. https://www.rubydoc.info/github/erikhuda/thor/master/Thor/Actions#create_file-instance_method https://www.rubydoc.info/github/erikhuda/thor/master/Thor/Actions#template-instance_method
* | | Merge pull request #36582 from f1337/masterRyuta Kamizono2019-07-021-2/+2
|\ \ \ | | | | | | | | [skip ci] use 'template' instead of 'create_file' for erb templates in generators guide
| * | | use 'template' instead of 'create_file' for erb templates in generators ↵Michael R Fleet2019-07-011-2/+2
|/ / / | | | | | | | | | guide [skip ci]
* | | bumps ZeitwerkXavier Noria2019-06-302-3/+3
| | | | | | | | | | | | | | | This version makes eager loading and autoloading consistent, as documented in the upgrading guide.
* | | adds two sections to the upgrading notes for autoloading [skip ci]Xavier Noria2019-06-301-0/+16
| | |
* | | Make `bin/setup` test pass even if the database does not existyuuji.yaginuma2019-06-301-1/+1
| | |
* | | Link to top of PR as well as other links [ci skip]yuuji.yaginuma2019-06-291-1/+1
| | |
* | | Add "SCHEMA" to the query in `configure_connection` like as other adaptersRyuta Kamizono2019-06-281-1/+1
| | | | | | | | | | | | | | | | | | | | | This makes to be able to ignore the query in `assert_queries` even if accidentally reconnected a connection. https://buildkite.com/rails/rails/builds/61917#4c49187a-3173-4d5c-8a8d-d65768f5bfc9/1000-1799
* | | warning: instance variable @serial not initialized (#36556)utilum2019-06-281-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduced in bba7c63a663b073034f4c73f0d59655751694e5a Before: ``` $ TESTOPTS="-n=/test_yaml_dump_and_load/" bundle exec rake test:postgresql :scisors: ... :scisors: Using postgresql Run options: -n=/test_yaml_dump_and_load/ --seed 36896 /home/u/code/rails/activerecord/lib/active_record/connection_adapters/postgresql/column.rb:15: warning: instance variable @serial not initialized /home/u/code/rails/activerecord/lib/active_record/connection_adapters/postgresql/column.rb:15: warning: instance variable @serial not initialized /home/u/code/rails/activerecord/lib/active_record/connection_adapters/postgresql/column.rb:15: warning: instance variable @serial not initialized /home/u/code/rails/activerecord/lib/active_record/connection_adapters/postgresql/column.rb:15: warning: instance variable @serial not initialized /home/u/code/rails/activerecord/lib/active_record/connection_adapters/postgresql/column.rb:15: warning: instance variable @serial not initialized /home/u/code/rails/activerecord/lib/active_record/connection_adapters/postgresql/column.rb:15: warning: instance variable @serial not initialized /home/u/code/rails/activerecord/lib/active_record/connection_adapters/postgresql/column.rb:15: warning: instance variable @serial not initialized /home/u/code/rails/activerecord/lib/active_record/connection_adapters/postgresql/column.rb:15: warning: instance variable @serial not initialized /home/u/code/rails/activerecord/lib/active_record/connection_adapters/postgresql/column.rb:15: warning: instance variable @serial not initialized /home/u/code/rails/activerecord/lib/active_record/connection_adapters/postgresql/column.rb:15: warning: instance variable @serial not initialized /home/u/code/rails/activerecord/lib/active_record/connection_adapters/postgresql/column.rb:15: warning: instance variable @serial not initialized /home/u/code/rails/activerecord/lib/active_record/connection_adapters/postgresql/column.rb:15: warning: instance variable @serial not initialized /home/u/code/rails/activerecord/lib/active_record/connection_adapters/postgresql/column.rb:15: warning: instance variable @serial not initialized /home/u/code/rails/activerecord/lib/active_record/connection_adapters/postgresql/column.rb:15: warning: instance variable @serial not initialized /home/u/code/rails/activerecord/lib/active_record/connection_adapters/postgresql/column.rb:15: warning: instance variable @serial not initialized /home/u/code/rails/activerecord/lib/active_record/connection_adapters/postgresql/column.rb:15: warning: instance variable @serial not initialized /home/u/code/rails/activerecord/lib/active_record/connection_adapters/postgresql/column.rb:15: warning: instance variable @serial not initialized /home/u/code/rails/activerecord/lib/active_record/connection_adapters/postgresql/column.rb:15: warning: instance variable @serial not initialized /home/u/code/rails/activerecord/lib/active_record/connection_adapters/postgresql/column.rb:15: warning: instance variable @serial not initialized /home/u/code/rails/activerecord/lib/active_record/connection_adapters/postgresql/column.rb:15: warning: instance variable @serial not initialized /home/u/code/rails/activerecord/lib/active_record/connection_adapters/postgresql/column.rb:15: warning: instance variable @serial not initialized /home/u/code/rails/activerecord/lib/active_record/connection_adapters/postgresql/column.rb:15: warning: instance variable @serial not initialized /home/u/code/rails/activerecord/lib/active_record/connection_adapters/postgresql/column.rb:15: warning: instance variable @serial not initialized /home/u/code/rails/activerecord/lib/active_record/connection_adapters/postgresql/column.rb:15: warning: instance variable @serial not initialized . Finished in 0.195325s, 5.1197 runs/s, 35.8376 assertions/s. 1 runs, 7 assertions, 0 failures, 0 errors, 0 skips ``` Co-authored-by: Ryuta Kamizono <kamipo@gmail.com>
* | | Merge pull request #36565 from rails/fix-url-configsEileen M. Uchitelle2019-06-273-2/+33
|\ \ \ | | | | | | | | Fix broken url configs
| * | | Fix broken url configseileencodes2019-06-273-2/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This PR is to fix #36559 but I also found other issues that haven't been reported. The check for `(config.size == 1 && config.values.all? { |v| v.is_a? String })` was naive. The only reason this passed was because we had tests that had single hash size configs, but that doesn't mean we don't want to create a hash config in other cases. So this now checks for `config["database"] || config["adapter"] || ENV["DATABASE_URL"]`. In the end for url configs we still get a UrlConfig but we need to pass through the HashConfig to create the right kind of UrlConfig. The UrlConfig's are really complex and I don't necessarily understand everything that's needed in order to act the same as Rails 5.2. I edited the connection handler test to demonstrate how the previous implementation was broken when checking config size. Now old and new tests pass so I think this is closer to 5.2. Fixes #36559
* | | | Address to "DEPRECATION WARNING: Uniqueness validator will no longer enforce ↵Ryuta Kamizono2019-06-281-1/+1
|/ / / | | | | | | | | | | | | | | | case sensitive comparison in Rails 6.1" Caused by #36210.
* | | Merge pull request #36560 from eileencodes/warn-if-database-yml-cant-be-readEileen M. Uchitelle2019-06-273-9/+48
|\ \ \ | | | | | | | | Warn if we can't read the yaml to create database tasks
| * | | Load initial database.yml once, and warn if we can't create taskseileencodes2019-06-273-9/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For multiple databases we attempt to generate the tasks by reading the database.yml before the Rails application is booted. This means that we need to strip out ERB since it could be reading Rails configs. In some cases like https://github.com/rails/rails/issues/36540 the ERB is too complex and we can't overwrite with the DummyCompilier we used in https://github.com/rails/rails/pull/35497. For the complex causes we simply issue a warning that says we couldn't infer the database tasks from the database.yml. While working on this I decided to update the code to only load the database.yml once initially so that we avoid having to issue the same warning multiple times. Note that this had no performance impact in my testing and is merely for not having to save the error off somewhere. Also this feels cleaner. Note that this will not break running tasks that exist, it will just mean that tasks for multi-db like `db:create:other_db` will not be generated. If the database.yml is actually unreadable it will blow up during normal rake task calls. Fixes #36540
* | | | [ci skip] Update free-programming-books link in getting started guideMasayuki Morita2019-06-261-1/+1
| | | | | | | | | | | | | | | | | | | | https://github.com/vhf/free-programming-books seems to have moved to https://github.com/EbookFoundation/free-programming-books
* | | | `length(title)` is a safe SQL string since #36448Ryuta Kamizono2019-06-261-2/+2
| | | |
* | | | Merge pull request #36555 from dineshpanda/update-initialization-guideRafael França2019-06-251-0/+4
|\ \ \ \ | | | | | | | | | | [ci skip] Refer actionmailbox and actiontext in the guide
| * | | | [ci skip] Refer actionmailbox and actiontext in the guidedineshpanda2019-06-261-0/+4
|/ / / /
* | | | Merge pull request #36553 from tatsuyafw/fix-robots-txt-urlRyuta Kamizono2019-06-252-2/+2
|\ \ \ \ | | | | | | | | | | Replace the www.robotstxt.org URL with https one [ci skip]
| * | | | Replace the www.robotstxt.org URL with https one [ci skip]Tatsuya Hoshino2019-06-252-2/+2
|/ / / / | | | | | | | | | | | | The robots.txt site is moved permanently to https URL.
* | | | Merge pull request #36530 from benoittgt/source_annotation_deprecation_issueRafael França2019-06-241-1/+1
|\ \ \ \ | |/ / / |/| | | Rely on Kernel require instead of self require
| * | | Rely on Kernel require instead of self requireBenoit Tigeot2019-06-221-1/+1
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With this code (exctracted from derailed_benchmarks): ```ruby require "bundler/inline" gemfile(true) do source "https://rubygems.org" gem "rails", "~> 6.0.0.rc1", require: false end FILES = [ "rails/engine/configuration", "rails/source_annotation_extractor", "active_support/deprecation" ] module Kernel alias :original_require :require def require(file) Kernel.require(file) end class << self alias :original_require :require end end Kernel.define_singleton_method(:require) do |file| original_require(file) end FILES.each do |file| puts "requiring file: #{file}" require file end ``` It fails with Rails 6 and the change introduced by 32065 ``` requiring file: rails/engine/configuration requiring file: rails/source_annotation_extractor Traceback (most recent call last): 11: from repro_derailed.rb:33:in `<main>' 10: from repro_derailed.rb:33:in `each' 9: from repro_derailed.rb:35:in `block in <main>' 8: from repro_derailed.rb:21:in `require' 7: from repro_derailed.rb:30:in `block in <main>' 6: from repro_derailed.rb:30:in `require' 5: from /Users/benoit.tigeot/.rvm/gems/ruby-2.5.1/gems/railties-6.0.0.rc1/lib/rails/source_annotation_extractor.rb:8:in `<top (required)>' 4: from /Users/benoit.tigeot/.rvm/gems/ruby-2.5.1/gems/activesupport-6.0.0.rc1/lib/active_support/deprecation/proxy_wrappers.rb:10:in `new' 3: from /Users/benoit.tigeot/.rvm/gems/ruby-2.5.1/gems/activesupport-6.0.0.rc1/lib/active_support/deprecation/proxy_wrappers.rb:10:in `new' 2: from /Users/benoit.tigeot/.rvm/gems/ruby-2.5.1/gems/activesupport-6.0.0.rc1/lib/active_support/deprecation/proxy_wrappers.rb:125:in `initialize' 1: from /Users/benoit.tigeot/.rvm/gems/ruby-2.5.1/gems/activesupport-6.0.0.rc1/lib/active_support/deprecation/proxy_wrappers.rb:23:in `method_missing' /Users/benoit.tigeot/.rvm/gems/ruby-2.5.1/gems/activesupport-6.0.0.rc1/lib/active_support/deprecation/proxy_wrappers.rb:148:in `warn': private method `warn' called for nil:NilClass (NoMethodError) ``` Related: - https://github.com/schneems/derailed_benchmarks/pull/130 - https://github.com/rails/rails/pull/32065
* | | Merge pull request #36210 from ↵Rafael França2019-06-244-1/+49
|\ \ \ | | | | | | | | | | | | | | | | vishaltelangre/raise-record-invalid-when-associations-fail-to-save-due-to-uniqueness-failure Fix: ActiveRecord::RecordInvalid is not raised when an associated record fails to #save! due to uniqueness validation failure
| * | | Fix: ActiveRecord::RecordInvalid is not raised when an associated record ↵Vishal Telangre2019-05-104-1/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fails to #save! due to uniqueness validation failure Add tests Fix tests failing due to introduction of uniquness rule added to Book model
* | | | Update link to OWASP XSS cheat sheet [ci skip]Aaron Suarez2019-06-231-1/+1
| | | |