aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | | | | Merge pull request #17172 from rselk/typoAbdelkader Boudih2014-10-032-2/+2
|\ \ \ \ \ \ \ | |_|/ / / / / |/| | | | | | fix typo in in define_model_callbacks comment [ci skip]
| * | | | | | fix typo in in define_model_callbacks comment [ci skip]Ryan Selk2014-10-032-2/+2
|/ / / / / /
* | | | | | Merge pull request #17168 from jwworth/task/fix_typoXavier Noria2014-10-031-1/+1
|\ \ \ \ \ \ | | | | | | | | | | | | | | Fix typo [ci skip]
| * | | | | | Fix typoJake Worth2014-10-031-1/+1
|/ / / / / /
* | | | | | Merge pull request #17167 from kuldeepaggarwal/doc-define_model_callbacksRafael Mendonça França2014-10-032-0/+6
|\ \ \ \ \ \ | | | | | | | | | | | | | | add notes for `define_model_callbacks`
| * | | | | | add notes for `define_model_callbacks` [ci skip]Kuldeep Aggarwal2014-10-032-0/+6
|/ / / / / /
* | | | | | Merge pull request #17160 from lsylvester/duration-hashAaron Patterson2014-10-032-0/+8
|\ \ \ \ \ \ | | | | | | | | | | | | | | define hash on duration
| * | | | | | define hash on durationlsylvester2014-10-032-0/+8
|/ / / / / /
* | | | | | minor fixes in the configuring guide [ci skip]Xavier Noria2014-10-031-15/+15
| | | | | |
* | | | | | Revert "Fix style for rescue responses doc [ci skip]"Xavier Noria2014-10-031-16/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reason: There is a wrong newline, a typo, and the change to singular is not good. This reverts commit d76380cf1ccec7ffeff19827ae9b6d9b71327418.
* | | | | | Merge pull request #17153 from yuki24/fix-doc-format-for-rescue-responsesAbdelkader Boudih2014-10-031-15/+16
|\ \ \ \ \ \ | | | | | | | | | | | | | | [Railsguides] Fix style for rescue responses doc [ci skip]
| * | | | | | Fix style for rescue responses doc [ci skip]Yuki Nishijima2014-10-021-15/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Change 'Any ***s that are...' to 'Any *** that is...' * Fix style for default rescue_responses setting This is a follow-up commit to: * https://github.com/rails/rails/pull/17076 * https://github.com/yuki24/rails/commit/89b8836f2470c689f6b7d52cab3a418bb63aef26
* | | | | | | Merge pull request #17151 from y-yagi/patch-1Abdelkader Boudih2014-10-031-0/+1
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | [ci skip] add `test:jobs` task to testing guide
| * | | | | | | [ci skip] add `test:jobs` task to testing guideyuuji.yaginuma2014-10-031-0/+1
| | | | | | | |
* | | | | | | | Merge pull request #17148 from mgenereu/patch-1Xavier Noria2014-10-021-1/+1
|\ \ \ \ \ \ \ \ | |_|_|/ / / / / |/| | | | | | | Disallow appended newlines when parsing as integer
| * | | | | | | Disallow appended newlines when parsing as integerMichael Genereux2014-10-021-1/+1
|/ / / / / / / | | | | | | | | | | | | | | \Z allows appended newlines where \z does not.
* | | | | | | Merge pull request #17068 from mokhan/update-active-job-documentationAbdelkader Boudih2014-10-026-5/+64
|\ \ \ \ \ \ \ | |_|_|_|_|/ / |/| | | | | | [ci-skip] Update Active Job API documentation
| * | | | | | Add documentation on Active Job.mo khan2014-10-026-5/+64
|/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds documentation for the Active Job API. It includes documentation on how to configure the queue_adapter, and how to create new jobs. It adds links to the various other sections of the Active Job documentation.
* | | | | | Merge pull request #17088 from robin850/jruby-devRafael Mendonça França2014-10-019-2/+12
|\ \ \ \ \ \ | | | | | | | | | | | | | | Follow up to #16613
| * | | | | | Follow up to #16613Robin Dupret2014-09-289-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since we want this flag to be enabled anytime we are running the tests under JRuby, let's enable this at the Rakefile level so people get the performance boost on their local checkout. Moreover, we avoid having to update this particular line anytime the option changes on the JRuby side. The only drawback is that we have to define it in every Rakefile but there's no big deal, this is already the case for other options.
* | | | | | | Merge pull request #17125 from acrogenesis/masterXavier Noria2014-10-012-2/+2
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | use tr instead of gsub when possible
| * | | | | | | use tr instead of gsub when possibleAdrian Rangel2014-10-012-2/+2
| | | | | | | |
* | | | | | | | Merge pull request #17124 from yuktikhurana/fix_render_file_guideAbdelkader Boudih2014-10-011-1/+1
|\ \ \ \ \ \ \ \ | |/ / / / / / / |/| | | | | | | In render file, by default the current layout is rendered always [ci skip]
| * | | | | | | In render file, by default the current layout is rendered alwaysyuktikhurana2014-10-011-1/+1
| | | | | | | |
* | | | | | | | Merge pull request #17113 from igor04/helpers-highlightRafael Mendonça França2014-09-302-1/+5
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | Added processing of `nil` to `highlight` helper method
| * | | | | | | | Added processing of `nil` to `highlight` helper methodigor042014-09-302-1/+5
| |/ / / / / / /
* | | | | | | | Merge pull request #17114 from pabloh/replace_use_of_eval_with_lambdaRafael Mendonça França2014-09-302-3/+5
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | Refactor callback setup to use lambda instead of eval
| * | | | | | | | Refactor callback setup in to use lambda instead of evalPablo Herrero2014-09-302-3/+5
| |/ / / / / / /
* | | | | | | | Generate the application pointing to rails-dom-testing masterRafael Mendonça França2014-09-301-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is temporary until we do the final release
* | | | | | | | Merge pull request #17118 from zhangsu/patch-1Abdelkader Boudih2014-09-301-1/+1
|\ \ \ \ \ \ \ \ | |/ / / / / / / |/| | | | | | | Update single table inheritance link anchor
| * | | | | | | Update single table inheritance link anchorSu Zhang (張甦)2014-09-301-1/+1
|/ / / / / / / | | | | | | | | | | | | | | The current one is old-of-date and doesn't make the browser navigation to the correct heading.
* | | | | | | Merge pull request #17110 from claudiob/remove-running-testsYves Senn2014-09-301-17/+0
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Remove RUNNING UNIT TESTS from ActionPack
| * | | | | | | Remove RUNNING UNIT TESTS from ActionPackclaudiob2014-09-301-17/+0
|/ / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [ci skip] Following discussion with @senny https://github.com/rails/rails/pull/17100#issuecomment-57285273 it only makes sense to keep this file form projects that require extra instructions.
* | | / / / / Responder was removed at ee77770d57de9da87b05a2fe84b9d46ec6852c62Akira Matsuda2014-09-301-1/+0
| |_|/ / / / |/| | | | |
* | | | | | fixes typo in AS CHANGELOG [ci skip]Xavier Noria2014-09-291-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | References f92ac24.
* | | | | | Merge pull request #17107 from kaspth/parse-html-as-fragmentsRafael Mendonça França2014-09-296-7/+9
|\ \ \ \ \ \ | | | | | | | | | | | | | | Parse HTML as document fragment.
| * | | | | | Parse HTML as document fragment.Kasper Timm Hansen2014-09-296-7/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This is to match the changes in Rails Dom Testing rails/rails-dom-testing#20.
* | | | | | | Merge pull request #17093 from ↵Aaron Patterson2014-09-298-22/+31
|\ \ \ \ \ \ \ | |/ / / / / / |/| | | | | | | | | | | | | | | | | | | | phiggins/remove-dynamic-send-on-built-in-callbacks Reduce allocations when running AR callbacks.
| * | | | | | Reduce allocations when running AR callbacks.Pete Higgins2014-09-288-22/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Inspired by @tenderlove's work in c363fff29f060e6a2effe1e4bb2c4dd4cd805d6e, this reduces the number of strings allocated when running callbacks for ActiveRecord instances. I measured that using this script: ``` require 'objspace' require 'active_record' require 'allocation_tracer' ActiveRecord::Base.establish_connection adapter: "sqlite3", database: ":memory:" ActiveRecord::Base.connection.instance_eval do create_table(:articles) { |t| t.string :name } end class Article < ActiveRecord::Base; end a = Article.create name: "foo" a = Article.find a.id N = 10 result = ObjectSpace::AllocationTracer.trace do N.times { Article.find a.id } end result.sort.each do |k,v| p k => v end puts "total: #{result.values.map(&:first).inject(:+)}" ``` When I run this against master and this branch I get this output: ``` pete@balloon:~/projects/rails/activerecord$ git checkout master M Gemfile Switched to branch 'master' pete@balloon:~/projects/rails/activerecord$ bundle exec ruby benchmark_allocation_with_callback_send.rb > allocations_before pete@balloon:~/projects/rails/activerecord$ git checkout remove-dynamic-send-on-built-in-callbacks M Gemfile Switched to branch 'remove-dynamic-send-on-built-in-callbacks' pete@balloon:~/projects/rails/activerecord$ bundle exec ruby benchmark_allocation_with_callback_send.rb > allocations_after pete@balloon:~/projects/rails/activerecord$ diff allocations_before allocations_after 39d38 < {["/home/pete/projects/rails/activesupport/lib/active_support/callbacks.rb", 81]=>[40, 0, 0, 0, 0, 0]} 42c41 < total: 630 --- > total: 590 ``` In addition to this, there are two micro-optimizations present: * Using `block.call if block` vs `yield if block_given?` when the block was being captured already. ``` pete@balloon:~/projects$ cat benchmark_block_call_vs_yield.rb require 'benchmark/ips' def block_capture_with_yield &block yield if block_given? end def block_capture_with_call &block block.call if block end def no_block_capture yield if block_given? end Benchmark.ips do |b| b.report("block_capture_with_yield") { block_capture_with_yield } b.report("block_capture_with_call") { block_capture_with_call } b.report("no_block_capture") { no_block_capture } end pete@balloon:~/projects$ ruby benchmark_block_call_vs_yield.rb Calculating ------------------------------------- block_capture_with_yield 124979 i/100ms block_capture_with_call 138340 i/100ms no_block_capture 136827 i/100ms ------------------------------------------------- block_capture_with_yield 5703108.9 (±2.4%) i/s - 28495212 in 4.999368s block_capture_with_call 6840730.5 (±3.6%) i/s - 34169980 in 5.002649s no_block_capture 5821141.4 (±2.8%) i/s - 29144151 in 5.010580s ``` * Defining and calling methods instead of using send. ``` pete@balloon:~/projects$ cat benchmark_method_call_vs_send.rb require 'benchmark/ips' class Foo def tacos nil end end my_foo = Foo.new Benchmark.ips do |b| b.report('send') { my_foo.send('tacos') } b.report('call') { my_foo.tacos } end pete@balloon:~/projects$ ruby benchmark_method_call_vs_send.rb Calculating ------------------------------------- send 97736 i/100ms call 151142 i/100ms ------------------------------------------------- send 2683730.3 (±2.8%) i/s - 13487568 in 5.029763s call 8005963.9 (±2.7%) i/s - 40052630 in 5.006604s ``` The result of this is making typical ActiveRecord operations slightly faster: https://gist.github.com/phiggins/e46e51dcc7edb45b5f98
* | | | | | | Merge pull request #17099 from sferik/each_keyRafael Mendonça França2014-09-297-12/+12
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Use Hash#each_key instead of Hash#keys.each
| * | | | | | | Use Hash#each_key instead of Hash#keys.eachErik Michaels-Ober2014-09-297-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Hash#keys.each allocates an array of keys; Hash#each_key iterates through the keys without allocating a new array. This is the reason why Hash#each_key exists.
* | | | | | | | Merge pull request #17086 from seuros/masterRafael Mendonça França2014-09-291-1/+1
|\ \ \ \ \ \ \ \ | |/ / / / / / / |/| | | | | | | correct filename for jobs tests
| * | | | | | | correct filename for jobs testsAbdelkader Boudih2014-09-281-1/+1
| |/ / / / / /
* | | | | | | Merge pull request #17092 from Empact/defunct-ivarsRafael Mendonça França2014-09-292-11/+7
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Remove defunct ivars
| * | | | | | | Remove defunct ivarsBen Woosley2014-09-282-11/+7
|/ / / / / / / | | | | | | | | | | | | | | | | | | | | | @column_names_with_alias, @dynamic_methods_hash, @time_zone_column_names, and @cached_time_zone
* | | | | | | Merge pull request #17087 from taboularasa/masterRobin Dupret2014-09-282-4/+4
|\ \ \ \ \ \ \ | |/ / / / / / |/| | | | | | technical correction in guides under 'Generating an engine' [ci skip]
| * | | | | | technical correction in guides under 'Generating an engine'David Elliott2014-09-282-4/+4
|/ / / / / / | | | | | | | | | | | | | | | | | | `bin/rails` would not exist outside of a rails project
* | | | | | Merge branch 'master' of github.com:rails/docrailsVijay Dev2014-09-285-17/+22
|\ \ \ \ \ \
| * | | | | | Consistently markup etag options.Steven Harman2014-09-161-3/+3
| | | | | | |
| * | | | | | Consistently capitalize ETag.Steven Harman2014-09-161-3/+3
| | | | | | |