- 04 8月, 2015 7 次提交
-
-
由 Claudio B. 提交于
migration and association guides: added some remarks about join tables
-
由 r11runner 提交于
-
由 Rafael Mendonça França 提交于
Allow Minitest to load plugins. Fixes #21102
-
由 Kasper Timm Hansen 提交于
Inform user to add script in correct location into the application.js manifest file [ci skip]
-
由 Mehmet Emin İNAÇ 提交于
use it change the warning
-
由 Kasper Timm Hansen 提交于
Fix the documentation of Hash#except method [ci skip]
-
由 Mehmet Emin İNAÇ 提交于
fix minor problems
-
- 03 8月, 2015 18 次提交
-
-
由 Yves Senn 提交于
This reverts commit 465f0fbc. This breaks some cases where non file / directory arguments are passed to the runner (for example db:migrate). I still think that we can get this to work. From what I can tell there is no reason why db:migrate is passed along to `Minitest.run`. I'll revert and investigate possible solutions.
-
由 Robin Dupret 提交于
-
由 Andrew White 提交于
Fixes #21085.
-
由 Kasper Timm Hansen 提交于
Publish the "Caching with Rails" guide
-
由 claudiob 提交于
-
由 Robin Dupret 提交于
-
由 Yves Senn 提交于
Inform user to add styles in correct location in application.css [ci skip]
-
由 Yves Senn 提交于
Before this patch, using `bin/rails test` with a non existing file or directory argument would silently swallow the argument and run the whole test suite. After the patch the command fails with `cannot load such file --`.
-
由 Yves Senn 提交于
Add missing assertion for test_route_with_colon_first
-
由 Aditya Kapoor 提交于
-
由 Yves Senn 提交于
Update Time#advance documentation with examples [ci skip]
-
由 Oleg Sukhodolsky 提交于
-
由 atul-shimpi 提交于
-
由 Michael Stock 提交于
-
由 Kasper Timm Hansen 提交于
Fix ambiguous argument warning
-
由 Mehmet Emin İNAÇ 提交于
encapsulate all arguments
-
由 Richard Schneeman 提交于
Use #start_with? and #[] for speed
-
由 Richard Schneeman 提交于
Save a string allocation inside loop
-
- 02 8月, 2015 6 次提交
-
-
由 Benjamin Quorning 提交于
In the `tag_options` method, strings are continuously added to the `output` string. Previously, we concatenated two strings and added the generated string to `output`. By adding each of the strings to `output`, one after the other, we will save the allocation of that concatenated string. Benchmark: require 'benchmark/ips' sep = " ".freeze Benchmark.ips do |x| x.report("string +") { output = "" output << sep + "foo" } x.report("string <<") { output = "" output << sep output << "foo" } x.compare! end Results (Ruby 2.2.2): Calculating ------------------------------------- string + 88.086k i/100ms string << 94.287k i/100ms ------------------------------------------------- string + 2.407M (± 5.8%) i/s - 12.068M string << 2.591M (± 7.0%) i/s - 12.917M Comparison: string <<: 2591482.4 i/s string +: 2406883.7 i/s - 1.08x slower
-
由 Benjamin Quorning 提交于
While the readability may be slightly worse, the speed improvement is significant: Twice as fast when there's no leading "/" to remove, and over 4 times as fast when there is a leading "/". Benchmark: require 'benchmark/ips' def match(controller) if controller if m = controller.match(/\A\/(?<controller_without_leading_slash>.*)/) m[:controller_without_leading_slash] else controller end end end def start_with(controller) if controller if controller.start_with?('/'.freeze) controller[1..-1] else controller end end end Benchmark.ips do |x| x.report("match") { match("no_leading_slash") } x.report("start_with") { start_with("no_leading_slash") } x.compare! end Benchmark.ips do |x| x.report("match") { match("/a_leading_slash") } x.report("start_with") { start_with("/a_leading_slash") } x.compare! end Result (Ruby 2.2.2): Calculating ------------------------------------- match 70.324k i/100ms start_with 111.264k i/100ms ------------------------------------------------- match 1.468M (± 7.1%) i/s - 7.314M start_with 3.787M (± 3.5%) i/s - 18.915M Comparison: start_with: 3787389.4 i/s match: 1467636.4 i/s - 2.58x slower Calculating ------------------------------------- match 36.694k i/100ms start_with 86.071k i/100ms ------------------------------------------------- match 532.795k (± 4.7%) i/s - 2.679M start_with 2.518M (± 5.8%) i/s - 12.566M Comparison: start_with: 2518366.8 i/s match: 532794.5 i/s - 4.73x slower
-
由 Arun Agrawal 提交于
correct example of button_tag [ci skip]
-
由 yuuji.yaginuma 提交于
wrapper div has been removed in cbb91745
-
由 Sean Griffin 提交于
PostgreSQL is strict about the usage of `DISTINCT` and `ORDER BY`, which one of the tests demonstrated. The order clause is never going to be relevant in the query we're performing, so let's just remove it entirely.
-
由 Sean Griffin 提交于
Add #cache_key to ActiveRecord::Relation.
-
- 01 8月, 2015 5 次提交
-
-
由 Richard Schneeman 提交于
[ci skip]
-
由 yui-knk 提交于
Add descriptions about `ActiveRecord::Base#to_param` to * `ActionDispatch::Routing::Base#match` * Overriding Named Route Parameters (guide) When passes `:param` to route definision, always `to_param` method of related model is overridden to constructe an URL by passing these model instance to named_helper.
-
由 Yves Senn 提交于
This is a follow up to #21008.
-
由 Yves Senn 提交于
Add documentation to get a running custom base controller [ci skip]
-
由 Yves Senn 提交于
-
- 31 7月, 2015 4 次提交
-
-
由 Yves Senn 提交于
Fix WARNINGS flag inside guides/Rakefile
-
由 Yves Senn 提交于
Don't fail when checking dependencies in bin/setup script
-
由 Rafael Mendonça França 提交于
Array#any? is slower and not the inverse of Array#empty?
-
由 Jean Boussier 提交于
``` empty_array = [] small_array = [1] * 30 bigger_array = [1] * 300 Benchmark.ips do |x| x.report('empty !empty?') { !empty_array.empty? } x.report('small !empty?') { !small_array.empty? } x.report('bigger !empty?') { !bigger_array.empty? } x.report('empty any?') { empty_array.any? } x.report('small any?') { small_array.any? } x.report('bigger any?') { bigger_array.any? } end ``` ``` Calculating ------------------------------------- empty !empty? 132.059k i/100ms small !empty? 133.974k i/100ms bigger !empty? 133.848k i/100ms empty any? 106.924k i/100ms small any? 85.525k i/100ms bigger any? 86.663k i/100ms ------------------------------------------------- empty !empty? 8.522M (± 7.9%) i/s - 42.391M small !empty? 8.501M (± 8.5%) i/s - 42.202M bigger !empty? 8.434M (± 8.6%) i/s - 41.894M empty any? 4.161M (± 8.3%) i/s - 20.743M small any? 2.654M (± 5.2%) i/s - 13.256M bigger any? 2.642M (± 6.4%) i/s - 13.173M ``` Ref: https://github.com/rails/rails/pull/21057#discussion_r35902468
-