aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Add CHANGELOG entryJames Dabbs2019-05-091-0/+2
|
* Delegate to the correct method in `ActionMailbox.mailbox_for`James Dabbs2019-05-051-1/+1
|
* Rename variable to represent typeJames Dabbs2019-05-051-2/+2
| | | | per comments from CR
* Expose `mailbox_for` methodJames Dabbs2019-05-044-5/+28
| | | | | | | Currently, the only exposed entry point into the ApplicationMailbox's configured routing system is to call `route`, which performs a lot of work to fully `process` inbound email. It'd be nice to have a way (e.g. in test) of checking which mailbox an email would route to without necessarily processing it yet.
* Fix test case name to fit file nameyuuji.yaginuma2019-05-041-1/+1
| | | | | | | | | This fixes the following warnings. ``` /rails/activemodel/test/cases/nested_error_test.rb:9: warning: method redefined; discarding old test_initialize /rails/activemodel/test/cases/error_test.rb:29: warning: previous definition of test_initialize was here ```
* Merge pull request #36172 from tgxworld/recover_pluck_perfRyuta Kamizono2019-05-041-0/+5
|\ | | | | Recover perf for `pluck` by reverting 9c9c950d02af83742a5f76302d0faa9…
| * Recover perf for `pluck` by reverting 9c9c950d02af83742a5f76302d0faa99508f242c.Guo Xiang Tan2019-05-031-0/+5
|/ | | | This reverts commit 9c9c950d02af83742a5f76302d0faa99508f242c.
* Merge pull request #36168 from ↵Ryuta Kamizono2019-05-031-20/+0
|\ | | | | | | | | yahonda/remove_redundant_test_too_many_binds_testcase Remove redundant `test_too_many_binds`
| * Remove redundant `test_too_many_binds`Yasuo Honda2019-05-031-20/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | with `ActiveRecord::BindParameterTest#test_too_many_binds` sqlite adapter has its own `bind_params_length`, `ActiveRecord::BindParameterTest#test_too_many_binds` respects it. * Modified `ActiveRecord::BindParameterTest#test_too_many_binds` to show `bind_params_length` value ``` $ git diff diff --git a/activerecord/test/cases/bind_parameter_test.rb b/activerecord/test/cases/bind_parameter_test.rb index 85685d1d00..83cd07f1d7 100644 --- a/activerecord/test/cases/bind_parameter_test.rb +++ b/activerecord/test/cases/bind_parameter_test.rb @@ -108,6 +108,7 @@ def test_statement_cache_with_sql_string_literal def test_too_many_binds bind_params_length = @connection.send(:bind_params_length) + p bind_params_length topics = Topic.where(id: (1 .. bind_params_length).to_a << 2**63) assert_equal Topic.count, topics.count $ ``` * Executed modified `ActiveRecord::BindParameterTest#test_too_many_binds` ``` $ bin/test test/cases/bind_parameter_test.rb -n test_too_many_binds Using sqlite3 Run options: -n test_too_many_binds --seed 47321 999 . Finished in 0.075249s, 13.2892 runs/s, 26.5784 assertions/s. 1 runs, 2 assertions, 0 failures, 0 errors, 0 skips $ ```
* | Merge pull request #36167 from alecclarke/update-file-extension-used-in-guideYuji Yaginuma2019-05-031-1/+1
|\ \ | |/ |/| [ci skip] Correct the stylesheet name used in the guide.
| * [ci skip] Correct the stylesheet name used in the guide.Alec Clarke2019-05-021-1/+1
|/ | | | | | | | | In the Action Text guides, `app/assets/stylesheets/actiontext.css` is specified as the file used to style the Action Text editor and content but the actual file generated from `rails action_text:install` is `app/assets/stylesheets/actiontext.scss`. This change simply corrects the file extension shown in the guide.
* Merge pull request #36166 from alexcameron89/add_action_cable_rnAlex Kitchens2019-05-021-11/+30
|\ | | | | Add Action Cable Release Notes
| * Add Action Cable Release Notes [ci skip]Alex Kitchens2019-05-021-11/+30
|/ | | | Co-Authored-By: प्रथमेश Sonpatki <csonpatki@gmail.com>
* Merge pull request #36131 from ↵Xavier Noria2019-05-023-12/+12
|\ | | | | | | | | Shopify/fix-association-extension-module-namespace Namespace association extension modules under the owner model
| * Namespace association extension modules under the owner modelJean Boussier2019-05-023-12/+12
|/
* Merge pull request #36152 from prathamesh-sonpatki/active-support-notesप्रथमेश Sonpatki2019-05-021-0/+186
|\ | | | | Active Support release notes [ci skip]
| * Update guides/source/6_0_release_notes.mdConnor Shea2019-05-021-1/+1
| | | | | | Co-Authored-By: prathamesh-sonpatki <csonpatki@gmail.com>
| * Added release notes for Active Support [ci skip]Prathamesh Sonpatki2019-05-021-0/+186
|/
* Merge pull request #36159 from sharang-d/update-getting-startedRyuta Kamizono2019-05-021-1/+1
|\ | | | | Update asset compression text [ci skip]
| * Update asset compression text [ci skip]Sharang Dashputre2019-05-021-1/+1
|/
* Make scope arity check consistent (#36134)Rob Trame2019-05-013-1/+20
| | | | | | | | * Make scope arity check consistent * Add test for arity change [Rob Trame + Rafael Mendonça França]
* Merge pull request #36149 from alexcameron89/add_active_storage_rnRafael França2019-05-011-2/+60
|\ | | | | Add Release Notes for Active Storage
| * Add Release Notes for Active Storage [ci skip]Alex Kitchens2019-05-011-2/+60
| | | | | | | | Co-authored-by: Abhay Nikam <nikam.abhay1@gmail.com>
* | Merge pull request #35337 from ↵Rafael França2019-05-013-8/+7
|\ \ | | | | | | | | | | | | abhaynikam/35265-remove-unused-argument-layout-from-rendered-template Removed unused layout attribute from RenderedTemplate
| * | Removed unused layout attribute from RenderedTemplateAbhay Nikam2019-03-093-8/+7
| | |
* | | Merge pull request #36155 from prathamesh-sonpatki/am-release-notesRafael França2019-05-011-0/+24
|\ \ \ | | | | | | | | Active Model release notes [ci skip]
| * | | Active Model release notes [ci skip]Prathamesh Sonpatki2019-05-011-0/+24
| | | |
* | | | Merge pull request #34642 from ↵Rafael França2019-05-012-1/+29
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | azimux/improve-hwia-initialize-by-skipping-to_h-if-already-a-hash HashWithIndifferentAccess#initialize performance improvement
| * | | | HashWithIndifferentAccess#initialize performance improvementMiles Georgi2018-12-062-1/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rails 4 -> Rails 5 introduced a #to_hash call in HashWithIndifferentAccess#initialize to guarantee access to the #default and #default_proc methods. This can be a very expensive operation for very large HashWithIndifferentAccess objects. This commit bypasses this #to_hash call if it is already a Hash.
* | | | | Merge pull request #36157 from prathamesh-sonpatki/getting-started-updatesRafael França2019-05-011-5/+3
|\ \ \ \ \ | | | | | | | | | | | | Updates to getting started per Rails 6.0 changes [ci skip]
| * | | | | Updates to getting started per Rails 6.0 changes [ci skip]Prathamesh Sonpatki2019-05-011-5/+3
| | |/ / / | |/| | |
* | | | | Merge pull request #36153 from yahonda/use_schema_to_ignoreRyuta Kamizono2019-05-013-19/+7
|\ \ \ \ \ | | | | | | | | | | | | Remove database specific sql statements from SQLCounter
| * | | | | Remove database specific sql statements from SQLCounterYasuo Honda2019-05-013-19/+7
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Every database executes different type of sql statement to get metadata then `ActiveRecord::TestCase` ignores these database specific sql statements to make `assert_queries` or `assert_no_queries` work consistently. Connection adapter already labels these statement by setting "SCHEMA" argument, this pull request makes use of "SCHEMA" argument to ignore metadata queries. Here are the details of these changes: * PostgresqlConnectionTest Each of PostgresqlConnectionTest modified just executes corresponding methods https://github.com/rails/rails/blob/fef174f5c524edacbcad846d68400e7fe114a15a/activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb#L182-L195 ```ruby # Returns the current database encoding format. def encoding query_value("SELECT pg_encoding_to_char(encoding) FROM pg_database WHERE datname = current_database()", "SCHEMA") end # Returns the current database collation. def collation query_value("SELECT datcollate FROM pg_database WHERE datname = current_database()", "SCHEMA") end # Returns the current database ctype. def ctype query_value("SELECT datctype FROM pg_database WHERE datname = current_database()", "SCHEMA") end ``` * BulkAlterTableMigrationsTest mysql2 adapter executes `SHOW KEYS FROM ...` to see if there is an index already created as below. I think the main concerns of these tests are how each database adapter creates or drops indexes then ignoring `SHOW KEYS FROM` statement makes sense. https://github.com/rails/rails/blob/fef174f5c524edacbcad846d68400e7fe114a15a/activerecord/lib/active_record/connection_adapters/mysql/schema_statements.rb#L11 ```ruby execute_and_free("SHOW KEYS FROM #{quote_table_name(table_name)}", "SCHEMA") do |result| ``` * Temporary change not included in this commit to show which statements executed ```diff $ git diff diff --git a/activerecord/test/cases/migration_test.rb b/activerecord/test/cases/migration_test.rb index 8e8ed494d9..df05f9bd16 100644 --- a/activerecord/test/cases/migration_test.rb +++ b/activerecord/test/cases/migration_test.rb @@ -854,7 +854,7 @@ def test_adding_indexes classname = ActiveRecord::Base.connection.class.name[/[^:]*$/] expected_query_count = { - "Mysql2Adapter" => 3, # Adding an index fires a query every time to check if an index already exists or not + "Mysql2Adapter" => 1, # Adding an index fires a query every time to check if an index already exists or not "PostgreSQLAdapter" => 2, }.fetch(classname) { raise "need an expected query count for #{classname}" @@ -886,7 +886,7 @@ def test_removing_index classname = ActiveRecord::Base.connection.class.name[/[^:]*$/] expected_query_count = { - "Mysql2Adapter" => 3, # Adding an index fires a query every time to check if an index already exists or not + "Mysql2Adapter" => 1, # Adding an index fires a query every time to check if an index already exists or not "PostgreSQLAdapter" => 2, }.fetch(classname) { raise "need an expected query count for #{classname}" $ ``` * Executed these modified tests ```ruby $ ARCONN=mysql2 bin/test test/cases/migration_test.rb -n /index/ Using mysql2 Run options: -n /index/ --seed 8462 F Failure: BulkAlterTableMigrationsTest#test_adding_indexes [/home/yahonda/git/rails/activerecord/test/cases/migration_test.rb:863]: 3 instead of 1 queries were executed. Queries: SHOW KEYS FROM `delete_me` SHOW KEYS FROM `delete_me` ALTER TABLE `delete_me` ADD UNIQUE INDEX `awesome_username_index` (`username`), ADD INDEX `index_delete_me_on_name_and_age` (`name`, `age`). Expected: 1 Actual: 3 bin/test test/cases/migration_test.rb:848 F Failure: BulkAlterTableMigrationsTest#test_removing_index [/home/yahonda/git/rails/activerecord/test/cases/migration_test.rb:895]: 3 instead of 1 queries were executed. Queries: SHOW KEYS FROM `delete_me` SHOW KEYS FROM `delete_me` ALTER TABLE `delete_me` DROP INDEX `index_delete_me_on_name`, ADD UNIQUE INDEX `new_name_index` (`name`). Expected: 1 Actual: 3 bin/test test/cases/migration_test.rb:879 .. Finished in 0.379245s, 10.5473 runs/s, 7.9105 assertions/s. 4 runs, 3 assertions, 2 failures, 0 errors, 0 skips $ ``` * ActiveRecord::ConnectionAdapters::Savepoints Left `self.ignored_sql` to ignore savepoint related statements because these SQL statements are not related "SCHEMA" ``` self.ignored_sql = [/^SAVEPOINT/, /^ROLLBACK TO SAVEPOINT/, /^RELEASE SAVEPOINT/] ``` https://github.com/rails/rails/blob/fef174f5c524edacbcad846d68400e7fe114a15a/activerecord/lib/active_record/connection_adapters/abstract/savepoints.rb#L10-L20 ```ruby def create_savepoint(name = current_savepoint_name) execute("SAVEPOINT #{name}") end def exec_rollback_to_savepoint(name = current_savepoint_name) execute("ROLLBACK TO SAVEPOINT #{name}") end def release_savepoint(name = current_savepoint_name) execute("RELEASE SAVEPOINT #{name}") end ```
* | | | | `@controller` may not be defined here, and if so, it causes a Ruby warningAkira Matsuda2019-05-011-1/+1
| | | | | | | | | | | | | | | | | | | | e.g. via test-unit-rails' `run_setup`
* | | | | Merge pull request #36150 from rails/error-any-delegationAaron Patterson2019-04-302-1/+12
|\ \ \ \ \ | | | | | | | | | | | | any? should be delegated to the errors list
| * | | | | any? should be delegated to the errors listAaron Patterson2019-04-302-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | Otherwise we get deprecation warnings in the generated scaffold template files
* | | | | | Merge pull request #36148 from ksolo/update-event-duration-in-notificationsEileen M. Uchitelle2019-04-302-6/+5
|\ \ \ \ \ \ | |/ / / / / |/| | | | | Revert changes to monotonic times
| * | | | | revert changes to monotonic timesKevin Solorio2019-04-302-6/+5
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The change to monotonic times causes failures for applications where the subscribed block is expecting Time objects as described in this issue: https://github.com/rails/rails/issues/36145 The original PR (https://github.com/rails/rails/pull/35984) was concerned with errors on the cpu_time. Test was edited to reflect changes to initializer using 0 values instead of nil
* | | | | Merge pull request #36146 from carlesjove/remove_outdated_gem_from_guidesRyuta Kamizono2019-05-011-21/+0
|\ \ \ \ \ | |_|_|_|/ |/| | | | | | | | | | | | | | [Guides] Remove dynamic_form gem reference in guides [ci skip]
| * | | | Remove dynamic_form gem references in guidesCarles Jove i Buxeda2019-04-301-21/+0
|/ / / / | | | | | | | | | | | | This gem has not been updated since April 2014 and 2 of the 4 methods it introduces have been broken since Rails 4
* | | | Merge pull request #36142 from kamipo/should_take_first_record_stateRyuta Kamizono2019-04-302-8/+11
|\ \ \ \ | |/ / / |/| | | Should take the record's state of first action in the transaction
| * | | Should take the record's state of first action in the transactionRyuta Kamizono2019-04-302-8/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the same id's records are saved and/or destroyed in the transaction, commit callbackes will only run for the first enrolled record. https://github.com/rails/rails/blob/a023e2180093ebc517a642aaf21f3c7241c67657/activerecord/lib/active_record/connection_adapters/abstract/transaction.rb#L115-L119 The regression #36132 is caused due to #35920 changed the enrollment order that the first action's record will be enrolled to last in the transaction. We could not change the the enrollment order as long as someone depends on the enrollment order. Fixes #36132.
* | | | Merge pull request #36137 from prathamesh-sonpatki/action-mailer-release-notesAlex Kitchens2019-04-301-0/+33
|\ \ \ \ | |/ / / |/| | | Action Mailer release notes [ci skip]
| * | | Action Mailer release notes [ci skip]Prathamesh Sonpatki2019-04-301-0/+33
| | | |
* | | | Fix rubocop offencesRyuta Kamizono2019-04-302-3/+3
|/ / /
* | | Merge pull request #36130 from alexcameron89/add_action_view_rnप्रथमेश Sonpatki2019-04-301-0/+53
|\ \ \ | | | | | | | | [ci skip] Add 6.0 Release Notes for Action View
| * | | [ci skip] Add 6.0 Release Notes for Action ViewAlex Kitchens2019-04-291-0/+53
| | | | | | | | | | | | | | | | I've added release notes based off of the CHANGELOG for Action View.
* | | | Merge pull request #36136 from robinjfisher/patch-1Ryuta Kamizono2019-04-301-1/+1
|\ \ \ \ | | | | | | | | | | Fix incorrect url in guide [ci skip]
| * | | | Fix incorrect url in guide [ci skip]Robin Fisher2019-04-291-1/+1
|/ / / / | | | | | | | | The example functional test lists the 'create' route as article_url rather than articles_url
* | | | Extract `_raise_record_not_touched_error`Ryuta Kamizono2019-04-292-16/+13
| | | |