- 01 5月, 2018 10 次提交
-
-
由 George Claghorn 提交于
Reset CONTENT_LENGTH between test requests
-
由 George Claghorn 提交于
Add quotes to code in rdoc comment in ActionController [ci skip]
-
由 Eddie Lebow 提交于
The example code is meant to be a string.
-
由 Eugene Kenny 提交于
If a POST request is followed by a GET request in a controller test, the `rack.input` and `RAW_POST_DATA` headers from the first request will be reset but the `CONTENT_LENGTH` header will leak, leading the request object in the second request to incorrectly believe it has a body.
-
由 George Claghorn 提交于
Document rails new <app> storage folder
-
由 Anthony Crumley 提交于
[ci skip] Active Storage now adds a storage folder to newly generated rails applications.
-
由 Rafael França 提交于
Fix an oxford comma
-
由 Anthony Crumley 提交于
[ci skip]
-
由 Rafael França 提交于
Fix test: threads being nil in ensure
-
由 Rafael França 提交于
Remove reference to Tokaido
-
- 30 4月, 2018 4 次提交
-
-
由 Pavel Valena 提交于
when connection_pool is not installed.
-
由 Jonathan Roes 提交于
-
由 Ryuta Kamizono 提交于
Fix url_helper examples in testing guide [ci skip]
-
由 Chris Houhoulis 提交于
-
- 29 4月, 2018 13 次提交
-
-
由 George Claghorn 提交于
References #32703.
-
由 Ryuta Kamizono 提交于
This improves the performance for the most ordinalized numbers (1st, 2nd, 3rd, etc). ``` require "benchmark/ips" def o1(number) abs_number = number.to_i.abs if (11..13).include?(abs_number % 100) "th" else case abs_number % 10 when 1; "st" when 2; "nd" when 3; "rd" else "th" end end end def o3(number) case number when 1; "st" when 2; "nd" when 3; "rd" when 4, 5, 6, 7, 8, 9, 10, 11, 12, 13; "th" else num_modulo = number.to_i.abs % 100 if 11 <= num_modulo && num_modulo <= 13 "th" else case num_modulo % 10 when 1; "st" when 2; "nd" when 3; "rd" else "th" end end end end def o4(number) case number when 1; "st" when 2; "nd" when 3; "rd" when 4, 5, 6, 7, 8, 9, 10, 11, 12, 13; "th" else num_modulo = number.to_i.abs % 100 num_modulo %= 10 if num_modulo > 13 case num_modulo when 1; "st" when 2; "nd" when 3; "rd" else "th" end end end puts RUBY_DESCRIPTION Benchmark.ips do |x| x.report("orig") { o1(1); o1(2); o1(3); o1(4); o1(11); o1(111); o1(1523) } x.report("ord3") { o3(1); o3(2); o3(3); o3(4); o3(11); o3(111); o3(1523) } x.report("ord4") { o4(1); o4(2); o4(3); o4(4); o4(11); o4(111); o4(1523) } x.compare! end ``` ``` ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin15] Warming up -------------------------------------- orig 25.305k i/100ms ord3 121.146k i/100ms ord4 124.944k i/100ms Calculating ------------------------------------- orig 275.496k (± 2.4%) i/s - 1.392M in 5.054720s ord3 1.649M (± 5.0%) i/s - 8.238M in 5.009801s ord4 1.700M (± 7.0%) i/s - 8.496M in 5.031646s Comparison: ord4: 1700059.6 i/s ord3: 1649154.9 i/s - same-ish: difference falls within error orig: 275496.3 i/s - 6.17x slower ``` Closes #25020. [lvl0nax, Jeremy Daer, Ryuta Kamizono]
-
由 George Claghorn 提交于
Match other services, which all use a 5 MB chunk size.
-
由 Ryuta Kamizono 提交于
Make Railties CI log for Ruby 2.6 accessible again
-
由 George Claghorn 提交于
Swap assertion order
-
由 utilum 提交于
Pending the next release of Thor which [fixes](https://github.com/erikhuda/thor/commit/006832ea32480618791f89bb7d9e67b22fc814b9) calls to `ERB.new`, Railties CI log for Ruby 2.6 is flooded with so many warnings it is too long for Travis to handle: ``` /home/travis/.rvm/gems/ruby-head/gems/thor-0.20.0/lib/thor/actions/file_manipulation.rb:120: warning: Passing safe_level with the 2nd argument of ERB.new is deprecated. Do not use it, and specify other arguments as keyword arguments. /home/travis/.rvm/gems/ruby-head/gems/thor-0.20.0/lib/thor/actions/file_manipulation.rb:120: warning: Passing trim_mode with the 3rd argument of ERB.new is deprecated. Use keyword argument like ERB.new(str, trim_mode: ...) instead. /home/travis/.rvm/gems/ruby-head/gems/thor-0.20.0/lib/thor/actions/file_manipulation.rb:120: warning: Passing eoutvar with the 4th argument of ERB.new is deprecated. Use keyword argument like ERB.new(str, eoutvar: ...) instead. The log length has exceeded the limit of 4 MB (this usually means that the test suite is raising the same exception over and over). The job has been terminated ``` https://travis-ci.org/rails/rails/jobs/372623604#L10000 https://api.travis-ci.org/v3/job/372623604/log.txt This patch forces installation of fixed Thor, and enables us to look at the the log.
-
由 utilum 提交于
`assert_directory("test/system")` may pass even if `assert_file("test/system/.keep")` fails.
-
由 Ryuta Kamizono 提交于
-
由 Ryuta Kamizono 提交于
The merging order was accidentally changed at #32447. The original intention is force `drop_table ... if_exists: true`. #28070.
-
由 Ryuta Kamizono 提交于
* Singular associations don't define `#association.nil?` * Wrap with <tt> for each method, not the whole sentence
-
由 George Claghorn 提交于
Don't allocate unnecessary array in translation helper
-
由 George Claghorn 提交于
[ci skip] update ActiveStorage documentation
-
由 Stefan Wienert 提交于
- added documentation on how to download files, with example of ActiveStorage::Downloading - documentation about linking files outside of controller/view - added section about DirectUpload JavaScript integration into libraries/frameworks, as well as usage in combination with Drag and Drop
-
- 28 4月, 2018 8 次提交
-
-
由 Max Melentiev 提交于
-
由 Vipul A M 提交于
[ci skip] Fix a typo in testing.md
-
由 Pradyumna Shembekar 提交于
-
由 Rafael França 提交于
Allow usage of strings as locals for partial renderer
-
由 Rafael França 提交于
Use MethodCallAssertions instead of mocha expects
-
由 Rafael França 提交于
`SetupAndTeardown` has few caveats that breaks libraries
-
由 Eileen M. Uchitelle 提交于
has_(one/many)_attached presence validation
-
由 simonjamain 提交于
* Adding precision about which letter case to use for controller names in routing Many people (including myself) encounter an error when having multiple words controller names and trying to put camelCase in their routes
-
- 27 4月, 2018 5 次提交
-
-
由 Ryuta Kamizono 提交于
Currently `ids_reader` doesn't respect dirty target when the target is not loaded yet unlike `collection.size`. I believe the inconsistency is a bug, fixes the `ids_reader` to behave consistently regardless of whether target is loaded or not.
-
由 Ryuta Kamizono 提交于
Loaded associations should not run a new query when size is called
-
由 Edouard CHIN 提交于
- In #32472 I introduced a fix in order for all `after_teardown` method provided by libraries and Rails to run, even if the application's `teardown` method raised an error (That's the default minitest behavior). However this change wasn't enough and doesn't take in consideration the ancestors chain. If a library's module containing an `after_teardown` method get included after the `SetupAndTeardown` module (one example is the [ActiveRecord::TestFixtures module](https://github.com/rails/rails/blob/7d2400ab61c8e3ed95e14d03ba3844e8ba2e36e4/activerecord/lib/active_record/fixtures.rb#L855-L856), then the ancestors of the test class would look something like ```ruby class MyTest < ActiveSupport::TestCase end puts MyTest.ancestors # [MyTest, ActiveSupport::TestCase, ActiveRecord::TestFixtures, ActiveSupport::Testing::SetupAndTeardown] ``` Any class/module in the ancestors chain that are **before** the `ActiveSupport::Testing::SetupAndTeardown` will behave incorrectly: - Their `before_setup` method will get called **after** all regular setup method - Their `after_teardown` method won't even get called in case an exception is raised inside a regular's test `teardown` A simple reproduction script of the problem here https://gist.github.com/Edouard-chin/70705542a59a8593f619b02e1c0a188c - One solution to this problem is to have the `AS::SetupAndTeardown` module be the very first in the ancestors chain. By doing that we ensure that no `before_setup` / `after_teardown` get executed prior to running the teardown callbacks
-
由 Jamie Dihiansan 提交于
* Update 'rails_welcome.png' to reflect a more diverse population * Cleanup 'rails_welcome.png'
-
由 Ryuta Kamizono 提交于
This is to ensure that the behavior has not changed before and after #31575.
-