- 02 2月, 2019 9 次提交
-
-
由 Andy Waite 提交于
[ci skip]
-
由 Aaron Patterson 提交于
Make Notifications::Fanout faster after changing subscriptions
-
由 John Hawthorn 提交于
When adding/removing a subscription with a string pattern, it isn't necessary to clear the entire cache, only the cache for the key being added. When adding/removing subscriptions for a regex or to match all events, the full cache is still cleared.
-
由 John Hawthorn 提交于
Previously we stored all subscribers in an array, and every time a new message name came in asked each subscriber if they responded to the message. This commit changes Fanout to hash subscribers with a String pattern by their pattern. This way we can look them up directly and only do the O(N) scan over the non-string (Regex or any) patterns.
-
由 Eileen M. Uchitelle 提交于
Refactor options for database selector middleware
-
由 Rafael França 提交于
Eagerly materialize the fixtures transaction
-
由 Ryuta Kamizono 提交于
ActiveSupport typo fixes.
-
由 alkesh26 提交于
-
由 Eileen Uchitelle 提交于
Right now we only have one option that's supported, the delay. However I can see us supporting other options in the future. This PR refactors the options to get passed into the resolver so whether you're using middleware or using the config options you can pass options to the resolver. This will also make it easy to add new options in the future.
-
- 01 2月, 2019 14 次提交
-
-
由 Eileen M. Uchitelle 提交于
include the content type when uploading to S3
-
由 Eileen M. Uchitelle 提交于
Railties typo fixes.
-
由 alkesh26 提交于
-
由 yuuji.yaginuma 提交于
* Fix broken format. * Need to specify driver to the first argument of `driven_by`. * `add_emulation` doesn't have `device` keyword. Ref: https://github.com/SeleniumHQ/selenium/blob/master/rb/lib/selenium/webdriver/chrome/options.rb#L142-L162
-
由 Ryuta Kamizono 提交于
Related 5754a29a. And follows Ruby standard library style https://github.com/ruby/ruby/commit/3406c5d.
-
由 Ryuta Kamizono 提交于
Fix has_many through association creation
-
由 Ryuta Kamizono 提交于
Remove unused attr_writers `visitor` and `indexes`
-
由 Yuji Yaginuma 提交于
Make the backquote operator always return a string
-
由 Aaron Patterson 提交于
-
由 Ryuta Kamizono 提交于
I deprecated two unused attr_writers `visitor` and `indexes` at 8056fe0d and f4bc364f conservatively, since those are accidentaly exposed in the docs. https://api.rubyonrails.org/v5.2/classes/ActiveRecord/ConnectionAdapters/AbstractAdapter.html https://api.rubyonrails.org/v5.2/classes/ActiveRecord/ConnectionAdapters/TableDefinition.html But I've found that `view_renderer` attr_writer is removed without deprecation at #35093, that is also exposed in the doc. https://api.rubyonrails.org/v5.2/classes/ActionView/Base.html I'd like to also remove the deprecated attr_writers since I think that removing `visitor` and `indexes` attr_writers is as safe as removing `view_renderer` attr_writer.
-
由 Vipul A M 提交于
ActiveRecord typo fixes. [ci skip]
-
由 Ryuta Kamizono 提交于
ActiveStorage typo fix. [ci skip]
-
由 Ryuta Kamizono 提交于
This reverts commit ed1eda27, reversing changes made to 3d2caab7. Reason: 7c3da6e0
-
由 Ryuta Kamizono 提交于
#33729 affected the behavior of the has_many through record creation. Since #33729, the intermediate reflection of simple has_many through association has `inverse_of` to the association, it causes extra through record creation, the extra through record required valid before the association record is saved. https://github.com/rails/rails/blob/23125378673bcc606b274027666a126573e136f8/activerecord/lib/active_record/associations/has_many_through_association.rb#L95-L102 I think that #33729 need to more work to care about has_many through association, that PR should be reverted to not break existing apps.
-
- 31 1月, 2019 15 次提交
-
-
由 Akinori MUSHA 提交于
ActiveSupport overrides `` Kernel#` `` so that it would not raise `Errno::ENOENT` but return `nil` instead (due to the last statement `STDERR.puts` returning nil) if a given command were not found. Because of this, you cannot safely say somthing like `` `command`.chomp `` when ActiveSupport is loaded. It turns out that this is an outdated monkey patch for Windows platforms to emulate Unix behavior on an ancient version of Ruby, and it should be removed by now.
-
由 alkesh26 提交于
-
由 alkesh26 提交于
-
由 Yuji Yaginuma 提交于
Fix typo: inherts -> inherits [ci skip]
-
由 Abhay Nikam 提交于
-
由 Ryuta Kamizono 提交于
We enabled `Style/RedundantBegin` cop at #34764, but it is hard to detect an offence if returning value put after the block.
-
由 yuuji.yaginuma 提交于
This fixes following warning. ``` warning: Passing safe_level with the 2nd argument of ERB.new is deprecated. Do not use it, and specify other arguments as keyword arguments. ```
-
由 Eileen M. Uchitelle 提交于
Write update_last_write_timestamp after request
-
由 Kasper Timm Hansen 提交于
ActiveModel typo fixes.
-
由 Yuji Yaginuma 提交于
Don't add `RAILS_ENV` in generate action
-
由 John Hawthorn 提交于
We need to update using the timestamp from the end of the request, not the start. For example, if a request spends 5+ seconds writing, we still want to wait another 5 seconds for replication lag. Since we now run the update after we yield, we need to use ensure to make sure we update the timestamp even if there is an exception.
-
由 alkesh26 提交于
-
由 Aaron Patterson 提交于
Tighten up the AV::Base constructor
-
由 Eileen M. Uchitelle 提交于
Part 8: Multi db improvements, Adds basic automatic database switching to Rails
-
由 Eileen Uchitelle 提交于
The following PR adds behavior to Rails to allow an application to automatically switch it's connection from the primary to the replica. A request will be sent to the replica if: * The request is a read request (`GET` or `HEAD`) * AND It's been 2 seconds since the last write to the database (because we don't want to send a user to a replica if the write hasn't made it to the replica yet) A request will be sent to the primary if: * It's not a GET/HEAD request (ie is a POST, PATCH, etc) * Has been less than 2 seconds since the last write to the database The implementation that decides when to switch reads (the 2 seconds) is "safe" to use in production but not recommended without adequate testing with your infrastructure. At GitHub in addition to the a 5 second delay we have a curcuit breaker that checks the replication delay and will send the query to a replica before the 5 seconds has passed. This is specific to our application and therefore not something Rails should be doing for you. You'll need to test and implement more robust handling of when to switch based on your infrastructure. The auto switcher in Rails is meant to be a basic implementation / API that acts as a guide for how to implement autoswitching. The impementation here is meant to be strict enough that you know how to implement your own resolver and operations classes but flexible enough that we're not telling you how to do it. The middleware is not included automatically and can be installed in your application with the classes you want to use for the resolver and operations passed in. If you don't pass any classes into the middleware the Rails default Resolver and Session classes will be used. The Resolver decides what parameters define when to switch, Operations sets timestamps for the Resolver to read from. For example you may want to use cookies instead of a session so you'd implement a Resolver::Cookies class and pass that into the middleware via configuration options. ``` config.active_record.database_selector = { delay: 2.seconds } config.active_record.database_resolver = MyResolver config.active_record.database_operations = MyResolver::MyCookies ``` Your classes can inherit from the existing classes and reimplment the methods (or implement more methods) that you need to do the switching. You only need to implement methods that you want to change. For example if you wanted to set the session token for the last read from a replica you would reimplement the `read_from_replica` method in your resolver class and implement a method that updates a new timestamp in your operations class.
-
- 30 1月, 2019 2 次提交
-
-
由 Eileen M. Uchitelle 提交于
Fix case when we want a UrlConfig but the URL is nil
-
由 Ryuta Kamizono 提交于
Remove unused code
-