aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* stop using an options hash with the cookie jarAaron Patterson2015-08-052-39/+31
| | | | | | | | The cookie jar can just ask the request object for the information it needs. This allows us to stop allocating hashes for options, and also allows us to delay calculating values in advance. Generating the options hash forced us to calculate values that we may never have needed at runtime
* move env access to the request object.Aaron Patterson2015-08-053-16/+48
| | | | | | Accessing a request object has nice advantages over accessing a hash. If you use a missing method name, you'll get an exception rather than a `nil` (is one nice feature)
* routes in the env via the request objectAaron Patterson2015-08-052-3/+6
|
* allocate a request object to avoid hash allocationsAaron Patterson2015-08-052-3/+6
| | | | | This decouples the `call` method from knowing the SCRIPT_NAME key and offloads decisions about how to access script_name
* Add missing HelloJob require.Kasper Timm Hansen2015-08-051-0/+1
| | | | This way JobSerializationTest runs in isolation without errors.
* Use exist? instead of deprecated exists?Kasper Timm Hansen2015-08-051-2/+2
|
* Merge pull request #20961 from ccallebs/add-dev-mode-cachingKasper Timm Hansen2015-08-057-2/+114
|\ | | | | Add dev caching toggle / server options
| * Add rake dev:cache task to enable dev mode caching.Chuck Callebs2015-08-047-2/+114
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Taken from @Sonopa's commits on PR #19091. Add support for dev caching via "rails s" flags. Implement suggestions from @kaspth. Remove temporary cache file if server does not have flags. Break at 80 characters in railties/CHANGELOG.md Remove ability to disable cache based on server options. Add more comprehensive options: --dev-caching / --no-dev-caching
* | Merge pull request #21112 from kamipo/fix_mysql2_versionRafael Mendonça França2015-08-041-1/+1
|\ \ | | | | | | Should use `server_info[:version]` instead of `info[:version]`
| * | Should use `server_info[:version]` instead of `info[:version]`Ryuta Kamizono2015-08-041-1/+1
| | | | | | | | | | | | | | | Because `info[:version]` is a client version, the server version is `server_info[:version]`.
* | | Merge pull request #20800 from xijo/make_active_job_locale_awareKasper Timm Hansen2015-08-0411-2/+111
|\ \ \ | | | | | | | | Make ActiveJob locale aware
| * | | Fixes #20799Johannes Opper2015-08-0411-2/+111
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When `#perform_later` is called the locale isn't stored on the queue, which results in a locale reset when the job is performed. An example of the problem: I18n.locale = 'de' HelloJob.perform_now # german message, correct but I18n.locale = 'de' HelloJob.perform_later # english message, incorrect This PR attaches the current I18n.locale to every job during the serialization process. It is then restored during deserialization and used to perform the job with the correct locale. It falls back to the default locale if no serialized locale is found in order to provide backward compatibility with previously stored jobs. It is not necessary to clear the queue for the update.
* | | | Merge pull request #21076 from r11runner/guide-join-tablesClaudio B.2015-08-032-10/+21
|\ \ \ \ | |_|/ / |/| | | migration and association guides: added some remarks about join tables
| * | | [ci skip] migration and association guides: added some remarks about join tablesr11runner2015-08-042-10/+21
| | |/ | |/|
* | | Merge pull request #21105 from os97673/allow-minitest-pluginsRafael Mendonça França2015-08-031-0/+1
|\ \ \ | | | | | | | | Allow Minitest to load plugins. Fixes #21102
| * | | Allow Minitest to load plugins. Fixes #21102Oleg Sukhodolsky2015-08-031-0/+1
| | | |
* | | | Merge pull request #21109 from vngrs/update_javascript_manifest_docKasper Timm Hansen2015-08-032-2/+2
|\ \ \ \ | | | | | | | | | | Inform user to add script in correct location into the application.js manifest file [ci skip]
| * | | | Inform user to add script in correct location into the application.js ↵Mehmet Emin İNAÇ2015-08-032-2/+2
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | manifest file [ci skip] use it change the warning
* | | | Merge pull request #21087 from vngrs/fix_hash_except_docKasper Timm Hansen2015-08-031-8/+9
|\ \ \ \ | | | | | | | | | | Fix the documentation of Hash#except method [ci skip]
| * | | | Fix the documentation of Hash#except method [ci skip]Mehmet Emin İNAÇ2015-08-031-8/+9
| | | | | | | | | | | | | | | | | | | | fix minor problems
* | | | | Revert "test runner should crash with non existing file argument."Yves Senn2015-08-032-6/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 465f0fbca3d4a1c269038b84ec9cc248fdab5fab. 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.
* | | | | Correctly close a fenced code block [ci skip]Robin Dupret2015-08-031-0/+1
| | | | |
* | | | | Add note to routing guide about overriding defaults [ci skip]Andrew White2015-08-031-0/+2
| | | | | | | | | | | | | | | | | | | | Fixes #21085.
* | | | | Merge pull request #21052 from robin850/caching-guideKasper Timm Hansen2015-08-032-51/+160
|\ \ \ \ \ | | | | | | | | | | | | Publish the "Caching with Rails" guide
| * | | | | Improve the "Caching with Rails" guide's introduction [ci skip]claudiob2015-08-031-2/+14
| | | | | |
| * | | | | Add a section about "Collection caching" [ci skip]Robin Dupret2015-08-031-0/+23
| | | | | |
| * | | | | Publish the "Caching with Rails" guide [ci skip]Celestino Gomes2015-07-281-0/+4
| | | | | |
| * | | | | Add a "Managing dependencies" part to the caching guide [ci skip]Robin Dupret2015-07-281-0/+87
| | | | | |
| * | | | | Tiny edits to the "Caching with Rails" guideRobin Dupret2015-07-281-49/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Fix a few typos * Remove reference to the old `memcache-client` gem * Remove the "ActiveSupport::Cache::EhCacheStore" part from the guide as the gem doesn't seem to be maintained anymore. * Move the "Custom Cache Stores" part under the "AS::Cache::Store" part as they are pretty related. [ci skip]
* | | | | | Merge pull request #21104 from atul-shimpi/masterYves Senn2015-08-032-2/+4
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Inform user to add styles in correct location in application.css [ci skip]
| * | | | | | Inform user to add styles in correct location in application.cssatul-shimpi2015-08-032-2/+4
| | |_|/ / / | |/| | | |
* | | | | | test runner should crash with non existing file argument.Yves Senn2015-08-032-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 --`.
* | | | | | Merge pull request #21095 from aditya-kapoor/add-missing-assertionYves Senn2015-08-031-2/+4
|\ \ \ \ \ \ | | | | | | | | | | | | | | Add missing assertion for test_route_with_colon_first
| * | | | | | Add missing assertion for test_route_with_colon_firstAditya Kapoor2015-08-031-2/+4
| | | | | | |
* | | | | | | Merge pull request #21103 from mikeastock/update_time_advance_docsYves Senn2015-08-031-0/+6
|\ \ \ \ \ \ \ | |_|/ / / / / |/| | | | | | Update Time#advance documentation with examples [ci skip]
| * | | | | | [ci skip] Update Time#advance documentation with examplesMichael Stock2015-08-021-0/+6
| |/ / / / /
* | | | | | Merge pull request #21093 from vngrs/fix_ambiguous_argument_warningKasper Timm Hansen2015-08-021-1/+1
|\ \ \ \ \ \ | | | | | | | | | | | | | | Fix ambiguous argument warning
| * | | | | | Fix ambiguous argument warningMehmet Emin İNAÇ2015-08-021-1/+1
| |/ / / / / | | | | | | | | | | | | | | | | | | encapsulate all arguments
* | | | | | Merge pull request #21100 from bquorning/route-setRichard Schneeman2015-08-021-2/+2
|\ \ \ \ \ \ | | | | | | | | | | | | | | Use #start_with? and #[] for speed
| * | | | | | Use #start_with? and #[] for speedBenjamin Quorning2015-08-021-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | | | | Merge pull request #21098 from bquorning/shovel-twice-and-save-a-stringRichard Schneeman2015-08-021-3/+8
|\ \ \ \ \ \ \ | |/ / / / / / |/| | | | | | Save a string allocation inside loop
| * | | | | | Save a string allocation inside loopBenjamin Quorning2015-08-021-3/+8
|/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | | | Merge pull request #21097 from y-yagi/fix_button_to_exampleArun Agrawal2015-08-021-1/+1
|\ \ \ \ \ \ | |/ / / / / |/| | | | | correct example of button_tag [ci skip]
| * | | | | correct example of button_tag [ci skip]yuuji.yaginuma2015-08-021-1/+1
|/ / / / / | | | | | | | | | | | | | | | wrapper div has been removed in cbb917455f306cf5818644b162f22be09f77d4b2
* | | | | Fix test failures caused by #20884Sean Griffin2015-08-011-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | | Merge pull request #20884Sean Griffin2015-08-016-0/+137
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | Add #cache_key to ActiveRecord::Relation.
| * | | | | Add #cache_key to ActiveRecord::Relation.Alberto F. Capel2015-07-206-0/+137
| | | | | |
* | | | | | Merge pull request #21088 from yui-knk/doc/to_paramRichard Schneeman2015-08-012-0/+29
|\ \ \ \ \ \ | | | | | | | | | | | | | | [ci skip]
| * | | | | | [ci skip]yui-knk2015-08-012-0/+29
| | |_|/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | | | docs, custom api base controllers shoudl subclass metal. [ci skip]Yves Senn2015-08-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | This is a follow up to #21008.