- 25 7月, 2020 8 次提交
-
-
由 Ryuta Kamizono 提交于
`attr.name` is already normalized as a string and alias resolved. Ref #39881.
-
由 Ryuta Kamizono 提交于
Fix argument naming in `AbstractStore#set_cookie`
-
由 Marc Rohloff 提交于
The signature in Rack https://github.com/rack/rack/blob/master/lib/rack/session/abstract/id.rb#L415 expects a response as the second argument
-
由 Ryuta Kamizono 提交于
-
由 Eugene Kenny 提交于
Add label attribute to <option> from include_blank
-
由 Jonathan Hefner 提交于
The `:include_blank` option of various `<select>`-related helpers causes an `<option>` element with no content to be rendered. However, the [HTML spec] says that unless an `<option>` element has a `label` attribute (which must be non-empty), its content must be "Text that is not inter-element whitespace." In #24923, this issue was addressed for `select_tag` by adding a `label` attribute to the `<option>`. This commit addresses the issue in the same manner for `FormBuilder#select` and various date / time select helpers. [HTML spec]: https://html.spec.whatwg.org/multipage/form-elements.html#the-option-element
-
由 Eugene Kenny 提交于
prevents raw redis and memcached compression
-
由 maxgurewitz 提交于
- Fixes issue where reads with raw: true using redis or memcached cache store, will compress values on reads. - Should speed up raw cache reads by preventing unnecessary cpu intensive operation.
-
- 24 7月, 2020 3 次提交
-
-
由 Eugene Kenny 提交于
Alter regexp on initialize to avoid extra ast pass
-
由 Eileen M. Uchitelle 提交于
Refactor `process` method
-
由 eileencodes 提交于
Awhile back tenderlove and I worked to improve performance of integration tests and remove controller tests. The second never happened, we ended up soft deprecating them but never did that completely. Now that we're revisting that work we need a way to override these two methods in tests so that we can convert tests in Rails to be integration tests instead of controller tests. Splitting these two concerns into two methods allows us to overwrite them to work for our needs while refactoring the test harness code. These methods are private because they should not be used by an application or gems, they will be removed when the refactoring has been completed. Co-authored-by: NAaron Patterson <tenderlove@ruby-lang.org>
-
- 23 7月, 2020 6 次提交
-
-
由 Daniel Colson 提交于
Along the same lines as #38901, #39903, and #39914, this commit removes one pass through the journey ast in an attempt to improve application boot time. Before this commit, `Mapper#path` would iterate through the ast to alter the regex for custom routes. With this commit we move the regex alterations to initialize, where we were already iterating through the ast. The Benchmark for this change is similar to what we have been seeing in the other PRs. ``` Warming up -------------------------------------- after 13.121k i/100ms before 7.416k i/100ms Calculating ------------------------------------- after 128.469k (± 3.1%) i/s - 642.929k in 5.009391s before 76.561k (± 1.8%) i/s - 385.632k in 5.038677s Comparison: after: 128469.4 i/s before: 76560.8 i/s - 1.68x (± 0.00) slower Calculating ------------------------------------- after 160.000 memsize ( 0.000 retained) 3.000 objects ( 0.000 retained) 0.000 strings ( 0.000 retained) before 360.000 memsize ( 0.000 retained) 6.000 objects ( 0.000 retained) 0.000 strings ( 0.000 retained) Comparison: after: 160 allocated before: 360 allocated - 2.25x more ```
-
由 Ryuta Kamizono 提交于
-
由 Ryuta Kamizono 提交于
Move Arel attribute normalization into `arel_table`
-
由 Ryuta Kamizono 提交于
Use `arel_table` directly instead.
-
由 Ryuta Kamizono 提交于
Consolidate passes through path ast
-
由 Daniel Colson 提交于
Along the same lines as https://github.com/rails/rails/pull/38901, this commit makes a small performance enhancement by iterating through the ast once instead of twice when initializing a Mapping. This stemmed from work to improve the boot time of an application with 3500+ routes. This patch only shaves off about 70ms from our boot time, and about 25000 allocations, but every little bit counts! Benchmark --- ```rb require "bundler/inline" gemfile(true) do source "https://rubygems.org" git_source(:github) { |repo| "https://github.com/#{repo}.git" } # Activate the gem you are reporting the issue against. gem "rails", path: "/Users/daniel/Desktop/oss/rails/rails" gem "benchmark-ips" gem "benchmark-memory", require: "benchmark/memory" end require "action_controller/railtie" class TestApp < Rails::Application config.root = __dir__ config.hosts << "example.org" config.session_store :cookie_store, key: "cookie_store_key" secrets.secret_key_base = "secret_key_base" config.logger = Logger.new($stdout) Rails.logger = config.logger routes.draw do get("/*wildcard", to: "controller#index") end end ``` With the benchmarking code inserted into Mapper#initialize: ```rb after = -> { path_params = [] wildcard_options = {} ast.each do |node| if node.symbol? path_params << node.to_sym elsif node.star? && formatted != false # Add a constraint for wildcard route to make it non-greedy and match the # optional format part of the route by default. wildcard_options[node.name.to_sym] ||= /.+?/ end end wildcard_options.merge(options) } before = -> { path_params = ast.find_all(&:symbol?).map(&:to_sym) add_wildcard_options(options, formatted, ast) } puts "IPS" Benchmark.ips do |x| x.report("before") { before.call } x.report("after") { after.call } x.compare! end puts "MEMORY" Benchmark.memory do |x| x.report("before") { before.call } x.report("after") { after.call } x.compare! end ``` The results are: ``` IPS Warming up -------------------------------------- before 14.352k i/100ms after 30.852k i/100ms Calculating ------------------------------------- before 135.675k (± 3.7%) i/s - 688.896k in 5.084368s after 288.126k (± 3.3%) i/s - 1.450M in 5.038072s Comparison: after: 288126.4 i/s before: 135675.1 i/s - 2.12x (± 0.00) slower MEMORY Calculating ------------------------------------- before 360.000 memsize ( 0.000 retained) 7.000 objects ( 0.000 retained) 0.000 strings ( 0.000 retained) after 200.000 memsize ( 0.000 retained) 4.000 objects ( 0.000 retained) 0.000 strings ( 0.000 retained) comparison: after: 200 allocated before: 360 allocated - 1.80x more end ```
-
- 22 7月, 2020 7 次提交
-
-
由 Jonathan Hefner 提交于
Fix minor typos in i18n docs [ci-skip]
-
由 Michael Hagar 提交于
-
由 Ryuta Kamizono 提交于
Added documentation for _default option added to ActiveRecord::Enum [ci skip]
-
由 Ryuta Kamizono 提交于
Fix enum losing attribute type cast.
-
由 Guo Xiang Tan 提交于
-
由 Mark Haussmann 提交于
Sendgrid, like Mailgun, only passes BCC recipients as a parameter in the original JSON payload. This PR adds code to prepend the recipients from the Sendgrid payload to the raw_email under the X-Original-To header. References #38738.
-
由 Abhay Nikam 提交于
-
- 21 7月, 2020 3 次提交
-
-
由 Ryuta Kamizono 提交于
Simplify attribute type decoration
-
由 Eugene Kenny 提交于
This would have made the correct implementation for 894ed87a more obvious.
-
由 Eugene Kenny 提交于
Bugfix for Mime::Type::MimeTypeInvalid handling in ActionDispatch::DebugExceptions
-
- 20 7月, 2020 4 次提交
-
-
由 Loren Norman 提交于
Co-authored-by: NEugene Kenny <elkenny@gmail.com>
-
由 Ryuta Kamizono 提交于
Avoid double time zone converter decoration when user-defined timestamp attribute with implicit type If type is given as a symbol, it will lookup a fresh type object via `Type.lookup`, but if type is omitted, `type_for_attribute` will lookup the database type which is already decorated by `define_attribute`. To avoid the double decoration, skip extra decoration if its type is already decorated.
-
由 Ryuta Kamizono 提交于
The internal attribute decoration is almost covered by the `attribute` with block, we don't need to have much code and extra class attribute.
-
由 Ryuta Kamizono 提交于
Using `decorate_matching_attribute_type` is overkill to do that.
-
- 19 7月, 2020 6 次提交
-
-
由 Ryuta Kamizono 提交于
Revert "Fix test_any in relations_test.rb, which was failing when relations_test.rb is run on its own (it passes when the entire suite is run). This is a hacky fix for a problem I didn't quite get to the bottom of, so I'd welcome a better solution..." This reverts commit d6289aad. `assert_queries` ignores "SCHEMA" queries by default since #36153.
-
由 Ryuta Kamizono 提交于
In Active Record internal, `arel_table` is not directly used but `arel_attribute` is used, since `arel_table` doesn't normalize an attribute name as a string, and doesn't resolve attribute aliases. For the above reason, `arel_attribute` should be used rather than `arel_table`, but most people directly use `arel_table`, both `arel_table` and `arel_attribute` are private API though. Although I'd not recommend using private API, `arel_table` is actually widely used, and it is also problematic for unscopeable queries and hash-like relation merging friendly, as I explained at #39863. To resolve the issue, this change moves Arel attribute normalization (attribute name as a string, and attribute alias resolution) into `arel_table`.
-
由 Eugene Kenny 提交于
Ensure principle tasks go before finish_template
-
由 Vipul A M 提交于
Document how exceptions are handled in instrumentation [ci skip]
-
由 Vipul A M 提交于
fix typo in Active Job exceptions docs [ci skip]
-
由 Henne Vogelsang 提交于
-
- 18 7月, 2020 3 次提交
-
-
由 fig 提交于
-
由 Eileen M. Uchitelle 提交于
Fix typos in active support docs [ci-skip]
-
由 Michael Hagar 提交于
-