aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* No difference between JRuby and CRuby at ↵Yasuo Honda2017-11-211-6/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | test_read_attributes_before_type_cast_on_a_boolean https://github.com/jruby/activerecord-jdbc-adapter ActiveRecord JDBC Adapter is actively developed and it supports Rails 5.1 now. This pull request addresses one of the failure when running ActiveRecord unit tests with ActiveRecord JDBC Adapter. As of right now, ActiveRecord JDBC Adapter supports Rails 5.1, not master branch then this test only can run on `5-1-stable` branch. But I have opened this pull request to `master` branch since this type cast should be going to work in the future versions of ActiveRecord JDBC Adapter . ```ruby $ ARCONN=jdbcmysql bin/test test/cases/attribute_methods_test.rb:203 Using jdbcmysql Run options: --seed 8874 F Finished in 0.709120s, 1.4102 runs/s, 1.4102 assertions/s. 1) Failure: AttributeMethodsTest#test_read_attributes_before_type_cast_on_a_boolean [/home/yahonda/git/rails/activerecord/test/cases/attribute_methods_test.rb:203]: Expected: "0" Actual: 0 1 runs, 1 assertions, 1 failures, 0 errors, 0 skips $ ```
* Merge pull request #31188 from tgxworld/update_rack_testYuji Yaginuma2017-11-211-1/+1
|\ | | | | FIX: `rack-test` 0.7.1 probably got yanked.
| * Update `rack-test` to 0.8.Guo Xiang Tan2017-11-211-1/+1
|/
* Remove unused `em-hiredis`yuuji.yaginuma2017-11-212-8/+0
| | | | `em-hiredis` is unused since 48766e32d31651606b9f68a16015ad05c3b0de2c
* Provide attachment writersGeorge Claghorn2017-11-202-0/+40
| | | | | | | | | | | | | Permit creating a record and attaching files in a single step. # Before: User.create!(user_params.except(:avatar)).tap do |user| user.avatar.attach(user_params[:avatar]) end # After: User.create!(user_params) [Yoshiyuki Hirano & George Claghorn]
* MemCacheStore: Support expiring countersTakumasa Ochi2017-11-203-2/+31
| | | | | | | Support `expires_in` in `ActiveSupport::Cache::MemCacheStore#increment` and `#decrement`. Closes #30716.
* Load 5.2 defaults in ASt dummy appGeorge Claghorn2017-11-201-1/+1
|
* Fix direct uploads to local serviceGeorge Claghorn2017-11-203-0/+6
| | | | | | | | Disable CSRF protection for ActiveStorage::DiskController#update. The local disk service is intended to imitate a third-party service like S3 or GCS, so we don't care where direct uploads originate: they’re authorized by signed tokens. Closes #30290. [Shinichi Maeshima & George Claghorn]
* Merge pull request #31185 from vipulnsward/threading-guideVipul A M2017-11-201-3/+3
|\ | | | | Pass over Execution guide[ci skip]
| * Pass over Execution guide[ci skip]Vipul A M2017-11-201-3/+3
|/
* Merge pull request #31170 from PHedkvist/system_testing_guidesMatthew Draper2017-11-201-0/+10
|\ | | | | [ci skip] Added example for using headless_chrome with SystemTest
| * [ci skip] Added example for using headless_chrome with ↵Pierre Hedkvist2017-11-181-0/+10
| | | | | | | | ActionDispatch::SystemTestCase
* | Permit attaching files to new recordsGeorge Claghorn2017-11-193-5/+53
| | | | | | | | Closes #31164.
* | Prevent extra `spawn` to make `klass.all` faster (#29009)Ryuta Kamizono2017-11-202-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These extra `spawn` are called via `klass.all` and `klass.all` is called everywhere in the internal. Avoiding the extra `spawn` makes` klass.all` 30% faster for STI classes. https://gist.github.com/kamipo/684d03817a8115848cec8e8b079560b7 ``` Warming up -------------------------------------- fast relation 4.410k i/100ms slow relation 3.334k i/100ms Calculating ------------------------------------- fast relation 47.373k (± 5.2%) i/s - 238.140k in 5.041836s slow relation 35.757k (±15.9%) i/s - 176.702k in 5.104625s Comparison: fast relation: 47373.2 i/s slow relation: 35756.7 i/s - 1.32x slower ```
* | Fix `test_session_store_with_expire_after` failure with rack-test 0.7.1Ryuta Kamizono2017-11-202-3/+3
| | | | | | | | https://travis-ci.org/rails/rails/jobs/304428814#L1977
* | Fix ASt CI failure with rack-test 0.7.1Ryuta Kamizono2017-11-201-1/+1
| | | | | | | | Due to https://github.com/rack-test/rack-test/commit/5fd3631078e7c73aaed7d4371f70fb2a79384be9.
* | Generate `keys` instead of `keys_to_names`Ryuta Kamizono2017-11-201-3/+3
| | | | | | | | `keys_to_names` is used only for `keys_to_names.keys`.
* | Fix formatting of `credentials` and `encrypted` [ci skip]yuuji.yaginuma2017-11-191-8/+8
| |
* | Fix "warning: assigned but unused variable - key"yuuji.yaginuma2017-11-181-1/+1
| | | | | | | | Ref: https://travis-ci.org/rails/rails/jobs/303840778#L1974
* | Deprecate an `after_bundle` callback in Rails plugin templatesyuuji.yaginuma2017-11-183-0/+40
| | | | | | | | | | | | | | | | | | Since fbd1e98cf983572ca9884f17f933ffe92833632a, Rails plugin does not run `bundle install` when generating. Therefore, `after_bundle` callback is not actually executed after `bundle`. Since there is a difference between the name and the actual behavior, I think that should be remove.
* | Merge pull request #31035 from BrentWheeldon/bmw-db-load-deadlockMatthew Draper2017-11-183-1/+74
|\ \ | |/ |/| Prevent deadlocks with load interlock and DB lock.
| * Prevent deadlocks with load interlock and DB lock.Brent Wheeldon2017-11-093-1/+74
| | | | | | | | | | | | | | | | | | | | This fixes an issue where competing threads deadlock each other. - Thread A holds the load interlock but is blocked on getting the DB lock - Thread B holds the DB lock but is blocked on getting the load interlock (for example when there is a `Model.transaction` block that needs to autoload) This solution allows for dependency loading in other threads while a thread is waiting to acquire the DB lock. Fixes #31019
* | Merge pull request #28742 from quixoten/stack_conn_poolMatthew Draper2017-11-172-6/+11
|\ \ | | | | | | Switch to LIFO for the connection pool
| * | Fix typosDevin Christensen2017-04-132-2/+2
| | |
| * | Improve documentation and add testDevin Christensen2017-04-132-7/+12
| | |
| * | Switch to LIFO for the connection poolDevin Christensen2017-04-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Using a FIFO for the connection pool can lead to issues when there are upstream components (pgbouncer, haproxy, etc.) that terminate connections that are idle after a period of time. Switching to a LIFO reduces the probability that a thread will checkout a connection that is about to be closed by an idle timeout in an upstream component.
* | | Merge pull request #28869 from eugeneius/query_cache_all_poolsMatthew Draper2017-11-172-6/+18
|\ \ \ | | | | | | | | Enable query cache on all connection pools
| * | | Enable query cache on all connection poolsEugene Kenny2017-04-242-6/+18
| | | | | | | | | | | | | | | | | | | | | | | | Since the query cache no longer eagerly checks out a connection, we can enable it on all connection pools at the start of every request, and it will only take effect for requests that actually use those pools.
* | | | Merge pull request #30100 from kirs/doc-reloaderMatthew Draper2017-11-171-0/+3
|\ \ \ \ | | | | | | | | | | Document public hooks in AS::Reloader
| * | | | Document public hooks in AS::Reloader [ci skip]Kir Shatrov2017-08-141-0/+3
| | | | |
* | | | | Move back to resque-scheduler mainline now that ↵Jeremy Daer2017-11-162-12/+11
| | | | | | | | | | | | | | | | | | | | https://github.com/resque/resque-scheduler/pull/620 is merged
* | | | | Merge pull request #31169 from ydakuka/patch-1Ryuta Kamizono2017-11-171-2/+2
|\ \ \ \ \ | | | | | | | | | | | | Fix links [ci skip]
| * | | | | Fix links [ci skip]Yauheni Dakuka2017-11-161-2/+2
|/ / / / /
* | | | | Avoid creating extra `relation` and `build_arel` in `_create_record` and ↵Ryuta Kamizono2017-11-172-63/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `_update_record` (#29999) Currently `_create_record` and `_update_record` in `Persistence` are creating extra `unscoped` and calling `build_arel` in the relation. But `compile_insert` and `compile_update` can be done without those expensive operation for `SelectManager` creation. So I moved the implementation to `Persistence` to avoid creating extra relation and refactored to avoid calling `build_arel`. https://gist.github.com/kamipo/8ed73d760112cfa5f6263c9413633419 Before: ``` Warming up -------------------------------------- _update_record 150.000 i/100ms Calculating ------------------------------------- _update_record 1.548k (±12.3%) i/s - 7.650k in 5.042603s ``` After: ``` Warming up -------------------------------------- _update_record 201.000 i/100ms Calculating ------------------------------------- _update_record 2.002k (±12.8%) i/s - 9.849k in 5.027681s ``` 30% faster for STI classes.
* | | | | Merge pull request #27494 from matthewd/executor-guideMatthew Draper2017-11-172-0/+329
|\ \ \ \ \ | | | | | | | | | | | | Start on a guide for the Executor & Load Interlock
| * | | | | Add more detail on how the framework is actually configured by defaultMatthew Draper2017-11-171-5/+67
| | | | | |
| * | | | | Start on a guide for the Executor & Load InterlockMatthew Draper2017-11-162-0/+267
|/ / / / /
* | | | | Merge pull request #31166 from freeletics/fix-exampleKasper Timm Hansen2017-11-161-1/+1
|\ \ \ \ \ | | | | | | | | | | | | Fixed example of `Rails.application.encrypted` method usage
| * | | | | Fixed example of `Rails.application.encrypted` method usageWojciech Wnętrzak2017-11-161-1/+1
|/ / / / / | | | | | | | | | | | | | | | [ci skip]
* | | | | Add master key to `gitignore` on `rails new`yuuji.yaginuma2017-11-164-1/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We generate master key on `rails new`. Therefore, if do not add master key to `.gitginore` on `rails new`as well, there is a possibility that the master key will be committed accidentally.
* | | | | Bump resque-scheduler ahead of a new gem releaseJeremy Daer2017-11-151-2/+2
| | | | |
* | | | | Pass options onto key file generator.Kasper Timm Hansen2017-11-151-1/+1
| | | | |
* | | | | Merge branch 'freeletics-manage-multiple-credential-files'Kasper Timm Hansen2017-11-159-41/+337
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | Fixes https://github.com/rails/rails/pull/30940
| * | | | | Add CLI to manage encrypted files/configs.Wojciech Wnętrzak2017-11-1510-50/+347
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To edit/show encrypted file: ``` bin/rails encrypted:edit config/staging_tokens.yml.enc bin/rails encrypted:edit config/staging_tokens.yml.enc --key config/staging.key bin/rails encrypted:show config/staging_tokens.yml.enc ``` Also provides a backing Rails.application.encrypted API for Ruby access: ```ruby Rails.application.encrypted("config/staging_tokens.yml.enc").read Rails.application.encrypted("config/staging_tokens.yml.enc").config Rails.application.encrypted("config/staging_tokens.yml.enc", key: "config/staging.key") ```
* | | | | | Go through a single credentials instance.Kasper Timm Hansen2017-11-151-9/+10
| | | | | | | | | | | | | | | | | | | | | | | | Instead of stashing the values in constants.
* | | | | | Merge pull request #31160 from yahonda/ignored_column_case_insensitiveRafael França2017-11-151-1/+1
|\ \ \ \ \ \ | | | | | | | | | | | | | | Allow test_ignored_columns_not_included_in_SELECT column names case insensitive
| * | | | | | Allow test_ignored_columns_not_included_in_SELECT column names caseYasuo Honda2017-11-151-1/+1
|/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | insensitive i.e. Oracle database identifier is UPPERCASE unlike other databases. ```ruby (byebug) query = Developer.all.to_sql "SELECT \"DEVELOPERS\".\"ID\", \"DEVELOPERS\".\"NAME\", \"DEVELOPERS\".\"SALARY\", \"DEVELOPERS\".\"FIRM_ID\", \"DEVELOPERS\".\"MENTOR_ID\", \"DEVELOPERS\".\"CREATED_AT\", \"DEVELOPERS\".\"UPDATED_AT\", \"DEVELOPERS\".\"CREATED_ON\", \"DEVELOPERS\".\"UPDATED_ON\" FROM \"DEVELOPERS\"" ```
* | | | | | Merge pull request #31128 from rails/handle-ambigious-timesAndrew White2017-11-154-1/+66
|\ \ \ \ \ \ | | | | | | | | | | | | | | Handle `TZInfo::AmbiguousTime` errors
| * | | | | | Handle `TZInfo::AmbiguousTime` errorsAndrew White2017-11-154-1/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make `ActiveSupport::TimeWithZone` match Ruby's handling of ambiguous times by choosing the later period, e.g. Ruby: ``` ENV["TZ"] = "Europe/Moscow" Time.local(2014, 10, 26, 1, 0, 0) # => 2014-10-26 01:00:00 +0300 ``` Before: ``` >> "2014-10-26 01:00:00".in_time_zone("Moscow") TZInfo::AmbiguousTime: 26/10/2014 01:00 is an ambiguous local time. ``` After: ``` >> "2014-10-26 01:00:00".in_time_zone("Moscow") => Sun, 26 Oct 2014 01:00:00 MSK +03:00 ``` Fixes #17395.
* | | | | | | Merge pull request #29776 from mrj/fix-idlw-timezoneMatthew Draper2017-11-151-1/+1
|\ \ \ \ \ \ \ | |/ / / / / / |/| | | | | | Fix the "International Date Line West" timezone