aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Only define attribute methods from schema cacheEugene Kenny2018-09-287-2/+109
| | | | | | | | | | | | | To define the attribute methods for a model, Active Record needs to know the schema of the underlying table, which is usually achieved by making a request to the database. This is undesirable behaviour while the app is booting, for two reasons: it makes the boot process dependent on the availability of the database, and it means every new process will make one query for each table, which can cause issues for large applications. However, if the application is using the schema cache dump feature, then the schema cache already contains the necessary information, and we can define the attribute methods without causing any extra database queries.
* Fix "warning: shadowing outer local variable - config"yuuji.yaginuma2018-09-261-2/+2
|
* Merge pull request #33968 from gmcgibbon/stringify_db_configurationsRafael França2018-09-253-2/+30
|\ | | | | Stringify database configurations
| * Stringify database configurationsGannon McGibbon2018-09-243-2/+30
| |
* | Merge pull request #33975 from JuanitoFatas/jf.fix-test-nameRafael França2018-09-251-1/+1
|\ \ | | | | | | [CaptureHelperTest] Fix a content_for test description
| * | Fix a content_for test descriptionJuanito Fatas2018-09-251-1/+1
| | |
* | | Remove `counter_cache_target` which is no longer calledRyuta Kamizono2018-09-261-10/+1
| | | | | | | | | | | | | | | `counter_cache_target` is called only when updated counter cache in replacing target, but it was already removed at #33913.
* | | Fix more offencesRafael Mendonça França2018-09-253-3/+3
| | |
* | | Change the empty block style to have space inside of the blockRafael Mendonça França2018-09-2560-141/+142
| | |
* | | Merge pull request #33974 from rails/remove-catch-all-from-amAaron Patterson2018-09-251-17/+7
|\ \ \ | | | | | | | | This patch removes deprecated catch-all routes from AM
| * | | This patch removes deprecated catch-all routes from AMAaron Patterson2018-09-241-17/+7
| | | | | | | | | | | | | | | | It also removes a monkey patch from AM::Base
* | | | Merge pull request #33973 from rails/remove-catch-allAaron Patterson2018-09-2519-78/+296
|\ \ \ \ | | | | | | | | | | Remove deprecated catch-all route in the AV tests
| * | | | make bot happyAaron Patterson2018-09-244-9/+9
| | | | |
| * | | | Add hack to deal with warningsAaron Patterson2018-09-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | We should be able to remove this once the catch-all route is gone from AP
| * | | | Remove deprecated catch-all route in the AV testsAaron Patterson2018-09-2419-78/+296
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit removes a deprecated catch-all route in the AV tests. It defines and includes the necessary routes for each test such that we don't need the catch-all anymore. This also helps push us toward #33970
* | | | Merge pull request #33977 from marshall-lee/abandon-top-supportRyuta Kamizono2018-09-2510-27/+4
|\ \ \ \ | | | | | | | | | | Abandon TOP support.
| * | | | Abandon TOP support.Vladimir Kochnev2018-09-2510-27/+4
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Initially, `TOP` was introduced to support `limit` for MSSQL database. Unlike PostgreSQL/MySQL/SQLite, MSSQL does not have native `LIMIT`/`OFFSET` support. The commit adding `TOP` is 1a246f71616cf246a75ef6cbdb56032e43d4e643. However, it figured out that `TOP` implementation was weak and it's not sufficient to also support `OFFSET`, then `TOP` was substituted with `ROW_NUMBER()` subquery in be48ed3071fd6524d0145c4ad3faeb4aafe3eda3. This is a well known trick in MSSQL - https://stackoverflow.com/questions/2135418/equivalent-of-limit-and-offset-for-sql-server. So now we don't need this `visit_Arel_Nodes_Top` at all. It does nothing useful but also adds an extra space after `SELECT` when `LIMIT` is being used for **any** database.
* | | | Merge pull request #33953 from wagurano/guides_markdown_custom_header_idRafael França2018-09-242-2/+7
|\ \ \ \ | | | | | | | | | | Fix rails guides markdown.rb and renderer.rb to use custom header id
| * | | | Fix rails guides markdown.rb and renderer.rb to use custom header idwagurano2018-09-232-2/+7
| | | | |
* | | | | Merge pull request #33964 from pskl/masterRafael França2018-09-241-1/+1
|\ \ \ \ \ | |_|_|_|/ |/| | | | Improve phrasing of one sentence in the contributing guide
| * | | | Improve phrasing of one sentence in the contributing guidePascal Lamouric2018-09-241-1/+1
| | | | |
* | | | | Merge pull request #33959 from eugeneius/eager_load_attribute_methodsRyuta Kamizono2018-09-252-0/+55
|\ \ \ \ \ | |/ / / / |/| | | | Eagerly define attribute methods in production
| * | | | Eagerly define attribute methods in productionEugene Kenny2018-09-242-0/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The attribute methods for a model are currently defined lazily the first time that model is instantiated, even when `config.eager_load` is true. This means the first request to use each model incurs the cost, which usually involves a database round trip to fetch the schema definition. By defining the attribute methods for all models while the application is booting, we move that work out of any individual request. When using a forking web server, this also reduces the number of times the schema definition is queried by doing it once in the parent process instead of from each forked process during their first request.
* | | | | Merge pull request #33960 from utilum/update_minimagick_version_to_4.9.2Ryuta Kamizono2018-09-241-2/+2
|\ \ \ \ \ | |/ / / / |/| | | | update mini_magick to the latest version
| * | | | update mini_magick to the latest versionutilum2018-09-241-2/+2
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | v 4.9.2 avoids some warnings that show in our tests. Although Gemfile.lock currently specifies 4.8.0, the CI already runs 4.9.2 so 4.8.0 warnings do not show in our CI logs.
* | | | Extract `instrument` method.Kasper Timm Hansen2018-09-231-26/+11
| | | | | | | | | | | | | | | | Similar to Action View's and Action Controller's instrument helpers.
* | | | `Persistence#increment!` requires an attribute argument which is incrementedRyuta Kamizono2018-09-242-1/+6
| | | |
* | | | Merge pull request #33829 from mtsmfm/encode-filenameKasper Timm Hansen2018-09-2310-82/+104
|\ \ \ \ | | | | | | | | | | Encode Content-Disposition filenames on send_data and send_file
| * | | | Encode Content-Disposition filenames on send_data and send_fileFumiaki MATSUSHIMA2018-09-1310-82/+104
| | | | |
* | | | | Merge pull request #33949 from sjain1107/no-private-defKasper Timm Hansen2018-09-239-72/+87
|\ \ \ \ \ | | | | | | | | | | | | Remove private def
| * | | | | Remove private defSakshi Jain2018-09-239-72/+87
| | | | | |
* | | | | | Merge pull request #33951 from abartov/patch-1George Claghorn2018-09-231-0/+2
|\ \ \ \ \ \ | |_|_|/ / / |/| | | | | Added mandatory region and bucket
| * | | | | Added mandatory region and bucketAsaf Bartov2018-09-231-0/+2
| |/ / / / | | | | | | | | | | The 'setup' section was misleadingly leaving out :bucket and :region in the sample, but servers don't start without them.
* | | | | Merge pull request #32971 from y-yagi/use_plus_operator_to_unfreeze_stringYuji Yaginuma2018-09-23101-364/+366
|\ \ \ \ \ | |/ / / / |/| | | | Enable `Performance/UnfreezeString` cop
| * | | | Enable `Performance/UnfreezeString` copyuuji.yaginuma2018-09-23101-364/+366
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 ```
* | | | Make sure this test check the issue solved in #31135Rafael Mendonça França2018-09-221-6/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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".
* | | | Fix "warning: shadowing outer local variable - job"yuuji.yaginuma2018-09-221-2/+2
| | | |
* | | | Merge pull request #33564 from avit/escape_javascript_castingRafael França2018-09-212-4/+9
|\ \ \ \ | | | | | | | | | | Let escape_javascript handle conversion to string
| * | | | Let escape_javascript handle conversion to stringAndrew Vit2018-09-212-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 %>
* | | | | No private def in the codebaseRafael Mendonça França2018-09-212-13/+16
| | | | |
* | | | | Merge pull request #33932 from schneems/schneems/recyclable-key-support-cacheRichard Schneeman2018-09-218-0/+69
|\ \ \ \ \ | | | | | | | | | | | | [close #33907] Error when using "recyclable" cache keys with a store that does not support it
| * | | | | Switch to supports_cache_versioning? check to a class methodschneems2018-09-208-29/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Moving the `supports_cache_versioning?` check to a class method. - Shorten the method doc. - Expand on the error message.
| * | | | | [close #33907] Error when using "recyclable" cache keys with a store that ↵schneems2018-09-208-0/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | does not support it 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.
* | | | | | Merge pull request #33940 from ianfleeton/chaptersRyuta Kamizono2018-09-211-13/+13
|\ \ \ \ \ \ | | | | | | | | | | | | | | Replace line items with chapters [ci skip]
| * | | | | | Replace line items with chapters [ci skip]Ian Fleeton2018-09-211-13/+13
|/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | Line items are a holdover from when orders were used in the examples instead of books.
* | | | | | Merge pull request #33934 from tgxworld/add_missing_test_caseRyuta Kamizono2018-09-211-0/+7
|\ \ \ \ \ \ | | | | | | | | | | | | | | Add missing test case for `redirect_to` when request includes a port.
| * | | | | | Add missing test case for `redirect_to` when request includes a port.Guo Xiang Tan2018-09-211-0/+7
| | | | | | |
* | | | | | | Merge pull request #33922 from ↵Richard Schneeman2018-09-201-0/+35
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | schneems/schneems/collection-caching-easier-to-understand [ci skip] document collection_caching.rb
| * | | | | | | [ci skip] document collection_caching.rbschneems2018-09-191-0/+35
| | | | | | | |
* | | | | | | | Merge pull request #33933 from davidcelis/patch-1Yuji Yaginuma2018-09-211-0/+1
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | Fix missing curly brace in documentation