- 23 9月, 2018 1 次提交
-
-
由 yuuji.yaginuma 提交于
In Ruby 2.3 or later, `String#+@` is available and `+@` is faster than `dup`. ```ruby # frozen_string_literal: true require "bundler/inline" gemfile(true) do source "https://rubygems.org" gem "benchmark-ips" end Benchmark.ips do |x| x.report('+@') { +"" } x.report('dup') { "".dup } x.compare! end ``` ``` $ ruby -v benchmark.rb ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux] Warming up -------------------------------------- +@ 282.289k i/100ms dup 187.638k i/100ms Calculating ------------------------------------- +@ 6.775M (± 3.6%) i/s - 33.875M in 5.006253s dup 3.320M (± 2.2%) i/s - 16.700M in 5.032125s Comparison: +@: 6775299.3 i/s dup: 3320400.7 i/s - 2.04x slower ```
-
- 22 9月, 2018 5 次提交
-
-
由 Rafael Mendonça França 提交于
Before this change this test was passing even if we revert #31135. The reason for that is that `app 'development'` will load the environment in the test process and it is happening before db_create_and_drop is called. This was not asserting that the environment was loaded in the db:create task itself. To test it we enhance the db:create task with a block that writes to a tmp file the value of the config. If the environment is loaded before that task enhancement runs the content of the file will have "true" insteand of "false".
-
由 yuuji.yaginuma 提交于
-
由 Rafael França 提交于
Let escape_javascript handle conversion to string
-
由 Rafael Mendonça França 提交于
-
由 Andrew Vit 提交于
This brings `escape_javascript` in line with the behavior of `json_escape` and allows other value types to be output without needing explicit casting in the view template. Example: <%= javascript_tag do %> var locale = '<%== j I18n.locale %>'; // locale is a symbol <% end %>
-
- 21 9月, 2018 19 次提交
-
-
由 Richard Schneeman 提交于
[close #33907] Error when using "recyclable" cache keys with a store that does not support it
-
由 Ryuta Kamizono 提交于
Replace line items with chapters [ci skip]
-
由 Ian Fleeton 提交于
Line items are a holdover from when orders were used in the examples instead of books.
-
由 Ryuta Kamizono 提交于
Add missing test case for `redirect_to` when request includes a port.
-
由 Richard Schneeman 提交于
[ci skip] document collection_caching.rb
-
由 schneems 提交于
- Moving the `supports_cache_versioning?` check to a class method. - Shorten the method doc. - Expand on the error message.
-
由 Guo Xiang Tan 提交于
-
由 Yuji Yaginuma 提交于
Fix missing curly brace in documentation
-
由 David Celis 提交于
This example was just missing a closing curly brace to complete the closure
😄 -
由 Rafael França 提交于
Ignore psqlrc files when executing psql commands
-
由 schneems 提交于
If you are using the "in cache versioning" also known as "recyclable cache keys" the cache store must be aware of this scheme, otherwise you will generate cache entries that never invalidate. This PR adds a check to the initialization process to ensure that if recyclable cache keys are being used via ``` config.active_record.cache_versioning = true ``` Then the cache store needs to show that it supports this versioning scheme. Cache stores can let Rails know that they support this scheme by adding a method `supports_in_cache_versioning?` and returning true.
-
由 George Claghorn 提交于
Correct spelling in "Contributing to Ruby on Rails" guide [ci skip]
-
由 bogdanvlviv 提交于
ambigity -> ambiguity Related to #33891
-
由 Rafael França 提交于
Make sure `assert_enqueued_with()` & `assert_performed_with()` work reliably with hash arguments
-
由 Rafael França 提交于
Contributing to Ruby on Rails Guide: standardize git remote names [ci skip].
-
由 Ryuta Kamizono 提交于
Since #33875, Rails dropped supporting MySQL 5.1 which does not support utf8mb4. We no longer need to use legacy utf8 (utf8mb3) conservatively.
-
由 Sharang Dashputre 提交于
The test helpers now treat `{ a: 1, b: 2 }` and `{ b: 2, a: 1 }` as equals
-
由 Rafael França 提交于
CI against PostgreSQL 10
-
由 Sean Griffin 提交于
Make a deep copy of the _default_attributes in column_defaults
-
- 20 9月, 2018 15 次提交
-
-
由 Ryuta Kamizono 提交于
Update MySQL server version and character set in Rails Guide [skip ci]
-
由 Yasuo Honda 提交于
Related to #33853
-
由 Yuji Yaginuma 提交于
Fixed to RAILS_MASTER_KEY as a default env key for decrypting.
-
由 Wojciech Wnętrzak 提交于
Fixes mistake left in https://github.com/rails/rails/pull/33521/files#diff-2a29095afcfe2c683b82a779a94c2208R59 and misunderstanding in https://github.com/rails/rails/commit/d69b04de0ff33237209afea6f6cac3ab27934908
-
由 Vitor Oliveira 提交于
-
由 Ryuta Kamizono 提交于
Make `ActiveRecord::Result#to_a` as alias to `ActiveRecord::Result#to_ary`
-
由 bogdanvlviv 提交于
`ActiveRecord::Result#to_a` was introduced in #33912. I would prefer to make `to_a` as alias to the `to_ary` because: - It would be clear for users from https://edgeapi.rubyonrails.org/classes/ActiveRecord/Result.html that `to_a` and `to_ary` are the same - For us it would take less efforts in case if we needed to change the docs or implementation, since the methods are the same Follow up #33912
-
由 Ryuta Kamizono 提交于
Don't update counter cache unless the record is actually saved
-
由 Rafael Mendonça França 提交于
When column_defaults is called it calls `value` on each instance of Attribute inside the _default_attributes set. Since value is memoized in the Attribute instance and that Attribute instance is shared across all instances of a model the next call to the default value will be memozied not running the proc defined by the user. Fixes #33031.
-
由 Rafael França 提交于
Deprecate ActiveRecord::Result#to_hash in favor of #to_a
-
由 yuuji.yaginuma 提交于
When using environment specific credentials, `RAILS_MASTER_KEY` is not used.
-
由 Yuji Yaginuma 提交于
Add CSP nonce to `style-src` directive
-
由 schneems 提交于
-
由 Wojciech Wnętrzak 提交于
For `production` environment look first for `config/credentials/production.yml.enc` file that can be decrypted by `ENV["RAILS_MASTER_KEY"]` or `config/credentials/production.key` master key. Edit given environment credentials file by command `rails credentials:edit --environment production`. Default behavior can be overwritten by setting `config.credentials.content_path` and `config.credentials.key_path`.
-
由 Rafael Mendonça França 提交于
When you pass an empty array to find we know we shoudl return an empty array but it is surprising that we are returning the original empty array instead of a new one.
-