- 08 1月, 2020 3 次提交
-
-
由 Genadi Samokovarov 提交于
While trying to fix #16433, we made the middleware deletions always happen at the end. While this works for the case of deleting the Rack::Runtime middleware, it makes operations like the following misbehave. ```ruby gem "bundler", "< 1.16" begin require "bundler/inline" rescue LoadError => e $stderr.puts "Bundler version 1.10 or later is required. Please update your Bundler" raise e end gemfile(true) do source "https://rubygems.org" git_source(:github) { |repo| "https://github.com/#{repo}.git" } gem "rails", github: "rails/rails" end require "action_controller/railtie" class TestApp < Rails::Application config.root = __dir__ secrets.secret_key_base = "secret_key_base" config.logger = Logger.new($stdout) Rails.logger = config.logger middleware.insert_after ActionDispatch::Session::CookieStore, ::Rails::Rack::Logger, config.log_tags middleware.delete ::Rails::Rack::Logger end require "minitest/autorun" require "rack/test" class BugTest < Minitest::Test include Rack::Test::Methods def test_returns_success get "/" assert last_response.ok? end private def app Rails.application end end ``` In the case
☝ ️ the ::Rails::Rack::Logger would be deleted instead of moved, because the order of middleware stack building execution will be: ```ruby [:insert, ActionDispatch::Session::CookieStore, [::Rails::Rack::Logger]] [:delete, ::Rails::Rack::Logger, [config.log_tags]] ``` This is pretty surprising and hard to reason about behaviour, unless you go spelunking into the Rails configuration code. I have a few solutions in mind and all of them have their drawbacks. 1. Introduce a `Rails::Configuration::MiddlewareStackProxy#delete!` that delays the deleted operations. This will make `#delete` to be executed in order. The drawback here is backwards incompatible behavior and a new public method. 2. Just revert to the old operations. This won't allow people to delete the `Rack::Runtime` middleware. 3. Legitimize the middleware moving with the new `#move_after` and `#move_before` methods. This does not breaks any backwards compatibility, but includes 2 new methods to the middleware stack. I have implemented `3.` in this pull request. Happy holidays!🎄 -
由 Eileen M. Uchitelle 提交于
Prevent NoMethodError on named route in integration test
-
由 Carlos Antonio da Silva 提交于
-
- 07 1月, 2020 14 次提交
-
-
由 Rafael França 提交于
Allow #nulls_first and #nulls_last in PostgreSQL
-
由 Rafael França 提交于
Add match 302 http code for log in redirect_to test
-
由 Rafael França 提交于
Update `open_ended?` to support new Ruby 2.6 endless and Ruby 2.7 beginless ranges
-
由 Stuart 提交于
-
由 Rafael Mendonça França 提交于
Fix collision check when using a generator and using the force option
-
由 Gannon McGibbon 提交于
Add ActiveRecord::Validations::NumericalityValidator
-
由 Gannon McGibbon 提交于
Add Active Record numericality validator with support for casting floats using a database columns' precision value.
-
由 Rafael França 提交于
Only assign @new_record_before_save once in autosave_association
-
由 Julian Nadeau 提交于
-
由 Rafael França 提交于
Use full option names in psql / pg_dump for clarity
-
由 Julian Nadeau 提交于
If we defined a callback before an association that updates the object, then this may end up being manipulated to being `false` when it should be `true`. We guard this be only defining it once. The implication of it being false, in this case, is that the children aren't updated with the parent_id and so they fail to associate to one another. See https://github.com/rails/rails/issues/38120 for more details
-
由 Simon Perepelitsa 提交于
-
由 John Hawthorn 提交于
Define mattr_* methods at caller's location
-
由 Simon Perepelitsa 提交于
-
- 06 1月, 2020 5 次提交
-
-
由 Eileen M. Uchitelle 提交于
Avoid unnecessary SQL query when calling ActiveRecord::Relation#cache_key
-
由 Rafael França 提交于
Add `:round_mode` parameter support to number helpers
-
由 Ryuta Kamizono 提交于
Fix the broken anchor of link [ci skip]
-
由 Takayuki Nakata 提交于
-
由 tom-lord 提交于
Support handling a `round_mode` in `ActiveSupport::NumberHelper::RoundingHelper` Add default value to locale file Update inline documentation with new parameter option Update CHANGELOG Add round_mode examples to all the tests Add I18n test Simplify logic Further simpification
-
- 05 1月, 2020 9 次提交
-
-
由 Rafael França 提交于
Include primary key in insert_all conflict target if specified
-
由 John Hawthorn 提交于
-
由 John Hawthorn 提交于
Before: [1] pry(main)> $ ActiveJob::Base.default_priority From: lib/active_support/core_ext/module/attribute_accessors.rb @ line 64: Owner: ActiveJob::QueuePriority::ClassMethods Visibility: public Number of lines: 3 def #{sym} @@#{sym} end After: [1] pry(main)> $ ActiveJob::Base.default_priority From: /home/jhawthorn/src/rails/activejob/lib/active_job/queue_priority.rb @ line 9: Owner: ActiveJob::QueuePriority::ClassMethods Visibility: public Number of lines: 1 mattr_accessor :default_priority
-
由 John Hawthorn 提交于
Previously this was incorrectly defining this attribute on the singleton class, which would end up actually using the class variable from Module.
-
-
由 Ryuta Kamizono 提交于
-
由 Ryuta Kamizono 提交于
Fix adding non-null column to existing SQLite3 table
-
由 Mike Vastola 提交于
Forces adding the column by way of copying the table due to lack of support in SQLite3 adapter. Fixes #38129
-
- 04 1月, 2020 9 次提交
-
-
由 Ryuta Kamizono 提交于
Avoid assigning duplicate values to join_values
-
由 Ryuta Kamizono 提交于
-
由 sinsoku 提交于
-
由 sinsoku 提交于
The ArgumentError occurs even though structures is compatible. Because some query methods keep duplicate values. For example, the behavior of `joins` method is as following: ```ruby relation = Post.joins(:author).joins(:author) relation.joins_values #=> [:author, :author] relation.or(Post.joins(:author)) #=> ArgumentError: Relation passed to #or must be structurally compatible. Incompatible values: [:joins] ``` This commit changes to not keep duplicate values. Fixes #38052
-
由 Rafael França 提交于
Update "The Hard Way" setup for Arch Linux
-
由 Keeyan Nejad 提交于
MariaDB cannot be started on Arch Linux before running a command to create the database files See https://wiki.archlinux.org/index.php/MariaDB#Installation It also appears that memcached is not started by default on Arch Linux, so it has been added to the systemctl startup step. This PR adds that step when setting up on Arch Linux
-
由 Rafael França 提交于
Pass env_name as a string in test databases
-
由 John Crepezzi 提交于
In 154abcab we switched from using `Rails.env` to fetch the `env_name` to `ActiveRecord::ConnectionHandling::DEFAULT_ENV.call.to_sym` which changed the type from a `String` to a `Symbol`. This commit brings things back to the original state, so we can find the configurations correctly! It also modifies the configuration in the configurations array, so that future connections can find the database with the updated keyword value.
-
由 Rafael Mendonça França 提交于
When all IPs are trusted, use the furthest away
-