aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Made ActiveRecord consistently use ActiveRecord::Type (notIain Beeston2016-10-038-9/+23
| | | | | | | | ActiveModel::Type) Some code was previously referring to ActiveModel::Type::*. This could cause issues in the future if any of the ActiveRecord::Type classes were overridden in the future.
* Temporarily make ACa tests noiser and more predictableMatthew Draper2016-10-031-1/+1
|
* Merge pull request #26425 from prathamesh-sonpatki/fix-nil-issueMatthew Draper2016-10-032-10/+19
|\ | | | | Fix issue with `cache_key` when the named timestamp column has value nil
| * Fix issue with `cache_key` when the named timestamp column has value nilPrathamesh Sonpatki2016-09-072-10/+19
| | | | | | | | | | | | | | - When the named timestamp column is nil, we should just return the cache_key with model name and id similar to the behavior of implicit timestamp columns. - Fixed one of the issue mentioned in https://github.com/rails/rails/issues/26417.
* | Shut down the worker pool - don't kill itMatthew Draper2016-10-031-1/+1
| | | | | | | | | | Different parts of concurrent-ruby's documentation make inconsistent claims about how kill will behave. It doesn't do the thing we want.
* | Merge pull request #26620 from maclover7/jm-ac-pg-bugMatthew Draper2016-10-032-2/+39
|\ \ | | | | | | Shutdown pubsub connection before classes are reloaded
| * | Add tests for Server::Base#restartJon Moss2016-10-021-0/+33
| | |
| * | Move behavior to Server::Base, and flush pubsubJon Moss2016-10-022-3/+6
| | |
| * | Shutdown pubsub connection before classes are reloadedJon Moss2016-10-021-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this patch, if you were to make a file edit in your Rails application and you tried to load up the page, it would hang indefinitely. The issue is that Active Record is trying to cleanup after itself and clear all active connection, but Action Cable is still holding onto a connection from the pool. To resolve this, we are now shutting down the pubsub adapter before classes are reloaded, to avoid this altogether (connection is being returned to the pool). Credits to @skateman for discovering this bug. :)
* | | Cache to_time to improve performance when comparingAndrew White2016-10-021-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In #25880 we tried to cache localtime to fix the performance regression but that proved to be difficult due to the fact that localtime/getlocal can take a utc_offset argument. We tried caching based on the argument but since the argument can be nil sometimes that meant that if the TZ environment variable changed then the cached value for nil became invalid. By moving the caching to DateAndTime#compatibility we don't have to worry about arguments since it doesn't take any. There is a possible edge condition where preserve_timezone is set to false and the system timezone changes then it could result in a cached value being incorrect but the only way to fix this would be to remove all caching and live with the performance issue.
* | | Revert "Merge pull request #25880 from ↵Andrew White2016-10-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ryandv/fix_performance_regression_in_timewithzone_to_time" Turns out trying to cache on localtime with arguments is too hard so we'll do it on DateAndTime::Compatibility#to_time instead. This reverts commit 3132fa6b7d9585e04eb44b25b55d298391b040b5, reversing changes made to 6949f8e5e7dc901d4e04ebab6c975afb33ca44c9.
* | | Revert "Merge pull request #26677 from tbalthazar/26644"Andrew White2016-10-023-30/+1
|/ / | | | | | | | | | | | | | | Turns out trying to cache on localtime with arguments is too hard so we'll do it on DateAndTime::Compatibility#to_time instead. This reverts commit 9ce2d1b1a43fc4ef3db59849b7412d30583a4074, reversing changes made to 53ede1aff2025d4391d0e05ba471fdaf3110a99c.
* | Merge pull request #26683 from y-yagi/add_cached_key_to_sql_active_record_eventJon Moss2016-10-021-6/+7
|\ \ | | | | | | add `cached` key to `sql.active_record` event [ci skip]
| * | add `cached` key to `sql.active_record` event [ci skip]yuuji.yaginuma2016-10-021-6/+7
| | | | | | | | | | | | Follow up to #26584
* | | Merge pull request #26672 from schpet/support_ruby_keywords_as_template_localsMatthew Draper2016-10-026-1/+47
|\ \ \ | | | | | | | | Avoid compiling ruby keywords into template locals
| * | | Change render to support any hash keys in localsPeter Schilling2016-10-026-1/+47
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | this lets you pass ruby keywords to templates: <%= render 'example', class: "cool" %> <%= render 'example', "spaces are" => "a-ok" %> <%= render 'example', Foo: "bar" %> Previously you'd see confusing syntax errors like this: SyntaxError (.../_example.html.erb:1: syntax error, unexpected '=' Now you can reference invalid identifiers through local_assigns. If you try to use an invalid keyword (e.g. class) in your template, you get a syntax error on the line where you use it.
* | | Merge pull request #26682 from matthewd/cable-testsMatthew Draper2016-10-025-63/+96
|\ \ \ | | | | | | | | Use websocket-client-simple instead of Faye in tests
| * | | Use websocket-client-simple instead of Faye as a websockets clientMatthew Draper2016-10-023-63/+87
| | | | | | | | | | | | | | | | | | | | | | | | Mostly, this is just to avoid EventMachine. But there's also an argument to be made that we're better off using a different protocol library for our test suite than the one we use to implement the server.
| * | | Shut down EventMachine before re-enabling warningsMatthew Draper2016-10-022-0/+9
| | | |
* | | | Merge pull request #26677 from tbalthazar/26644Andrew White2016-10-013-1/+30
|\ \ \ \ | |/ / / |/| | | Fix `ActiveSupport::TimeWithZone#localtime`
| * | | Fix `ActiveSupport::TimeWithZone#localtime`Thomas Balthazar2016-10-013-1/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously memoization in `localtime` wasn't taking the `utc_offset` parameter into account when returning a cached value. It now caches the computed value depending on the `utc_offset` parameter, e.g: Time.zone = "US/Eastern" t = Time.zone.local(2016,5,2,11) # => Mon, 02 May 2016 11:00:00 EDT -04:00 t.localtime(-7200) # => 2016-05-02 13:00:00 -0200 t.localtime(-3600) # => 2016-05-02 14:00:00 -0100
* | | | Merge pull request #26678 from larskanis/patch-1Matthew Draper2016-10-021-0/+1
|\ \ \ \ | | | | | | | | | | Add missing require for zlib in ActiveRecord::Migrator
| * | | | Add missing require for zlibLars Kanis2016-10-011-0/+1
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Zlib is used to generate the advisory lock since commit 2c2a8755460 . Using the Migrator fails since then, when it is called without the rails context: NameError: uninitialized constant ActiveRecord::Migrator::Zlib This patch fixes the above error.
* | | | Remove obsolete comment about class-level respond_toAndrew White2016-10-011-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | The class-level respond_to was extracted in ee77770 to responders gem [ci skip]
* | | | Merge pull request #26676 from matthewd/no-faye-modeMatthew Draper2016-10-0115-185/+8
|\ \ \ \ | | | | | | | | | | Remove Faye mode
| * | | | In-line the configuration points that only existed for Faye supportMatthew Draper2016-10-015-13/+4
| | | | |
| * | | | Remove Faye modeMatthew Draper2016-10-0112-175/+7
| | | | | | | | | | | | | | | | | | | | No deprecation, because it was never documented.
* | | | | Make PG deadlock error more deterministicMatthew Draper2016-10-011-9/+12
|/ / / / | | | | | | | | | | | | | | | | We've seen occasional Travis failures mentioning deadlocks. I think they're escaping from this test.
* | | | Merge pull request #26547 from ↵Matthew Draper2016-10-019-24/+83
|\ \ \ \ | |_|/ / |/| | | | | | | | | | | | | | | palkan/fix/actioncable-confirmation-race-condition Avoid race condition on subscription confirmation
| * | | Add Channel#ensure_confirmation_sent; call #subscribe_to_channel after ↵palkan2016-09-227-33/+39
| | | | | | | | | | | | | | | | initializing
| * | | [Fix #25381] Avoid race condition on subscription confirmationpalkan2016-09-206-15/+60
| | | |
* | | | Merge pull request #26675 from j1wilmot/update-docsJon Moss2016-09-301-1/+0
|\ \ \ \ | | | | | | | | | | Remove dup distinct from AR query list doc [ci skip]
| * | | | Remove dup distinct from AR query list [ci skip]Jeremy Wilmot2016-09-301-1/+0
|/ / / /
* | | | Merge pull request #26584 from Shopify/cached-query-nameRafael França2016-09-304-11/+18
|\ \ \ \ | | | | | | | | | | Preserve cached queries name in AS notifications
| * | | | Preserve cached queries name in AS notificationsJean Boussier2016-09-224-11/+18
| | | | |
* | | | | Merge pull request #26646 from matthewd/cable-bufferMatthew Draper2016-10-014-12/+100
|\ \ \ \ \ | | | | | | | | | | | | Buffer writes to the cable sockets
| * | | | | Buffer writes to the cable socketsMatthew Draper2016-09-284-12/+100
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Otherwise, they can sometimes block, leading to reduced system throughput.
* | | | | | Merge pull request #26147 from matthewd/callback-backtraceMatthew Draper2016-10-012-135/+274
|\ \ \ \ \ \ | |_|_|_|/ / |/| | | | | Callbacks: leave less lines in the backtrace
| * | | | | Tighten the backtrace pollution from passing through callbacksMatthew Draper2016-09-302-135/+274
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Callbacks are everywhere, so it's better if we can avoid making a mess of the backtrace just because we've passed through a callback hook. I'm making no effort to the before/after invocations: those only affect backtraces while they're running. The calls that matter are the ones that remain on the call stack after run_callbacks yields: around callbacks, and internal book-keeping around the before/afters.
* | | | | Don't skip in-memory insertion of associations when loaded in validateSean Griffin2016-09-294-16/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was caused by 6d0d83a33f59d9415685852cf77818c41e2e2700. While the bug it's trying to fix is handled if the association is loaded in an after_(create|save) callback, it doesn't handle any cases that load the association before the persistence takes place (validation, or before_* filters). Instead of caring about the timing of persistence, we can just ensure that we're not double adding the record instead. The test from that commit actually broke, but it was not because the bug has been re-introduced. It was because `Bulb` in our test suite is doing funky things that look like STI but isn't STI, so equality comparison didn't happen as the loaded model was of a different class. Fixes #26661.
* | | | | Merge pull request #26660 from unasuke/fix_typo_in_5_0_release_notesVipul A M2016-09-291-1/+1
|\ \ \ \ \ | | | | | | | | | | | | Fix typo in 5_0_release_notes.md doc [ci skip]
| * | | | | Fix typo in 5_0_release_notes.md doc [ci skip]Yusuke Nakamura2016-09-291-1/+1
|/ / / / /
* | | | | Merge pull request #26659 from y-yagi/remove_mongrel_once_againKasper Timm Hansen2016-09-291-1/+1
|\ \ \ \ \ | | | | | | | | | | | | remove `mongrel` once again
| * | | | | remove `mongrel` once againyuuji.yaginuma2016-09-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | `mongrel` was removed in #26408. But have back accidentally in #26414.
* | | | | | Merge pull request #26402 from mtsmfm/remove-dead-constantsAkira Matsuda2016-09-291-30/+0
|\ \ \ \ \ \ | |/ / / / / |/| | | | | Remove dead constants
| * | | | | Remove dead constantsFumiaki MATSUSHIMA2016-09-061-30/+0
| | | | | | | | | | | | | | | | | | | | | | | | It seems that we forgot to remove some codes on https://github.com/rails/rails/commit/7ab47751068c6480e7e44fc9265a7e690dd4af3b
* | | | | | Merge pull request #26648 from y-yagi/update_description_of_queue_adapterJon Moss2016-09-281-2/+2
|\ \ \ \ \ \ | | | | | | | | | | | | | | update description of queue adapter in test [ci skip]
| * | | | | | update description of queue adapter in test [ci skip]yuuji.yaginuma2016-09-281-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `ActiveJob::TestCase` set `TestAdapter` to queue adapter at `before_setup`. https://github.com/rails/rails/blob/master/activejob/lib/active_job/test_helper.rb#L12..L21
* | | | | | | Merge pull request #26654 from Neodelf/activesupport_1Jon Moss2016-09-281-1/+1
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | [ci skip] Remove not necessary whitespace
| * | | | | | | [ci skip] Remove not necessary whitespaceAndrey Molchanov2016-09-281-1/+1
| | | | | | | |