aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | | | | | | Fix database configuration when adding another config leveleileencodes2019-03-182-1/+3
| | |_|_|_|/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is kind of hard to explain but if you have a database config with another level like this: ``` development: primary: database: "my db" variables: statement_timeout: 1000 ``` the database configurations code would chooke on the `variables` level because it didn't know what to do with it. We'd see the following error: ``` lib/active_record/database_configurations.rb:72:in `block in find_db_config': undefined method `env_name' for [nil]:Array (NoMethodError) ``` The problem here is that Rails does correctly identify this as not a real configuration but returns `[nil]` along with the others. We need to make sure to flatten the array and remove all the `nil`'s before returning the `configurations` objects. Fixes #35646
* | | | | | | | Simplify values_list with more compositionKasper Timm Hansen2019-03-181-24/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This also prevents insert_all from leaking its attributes checks.
* | | | | | | | Extract column check in values_listKasper Timm Hansen2019-03-181-14/+14
|/ / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `values_list` is quite long and does far too many things. This also eagerly extract the keys in initialize instead of having to worry about calling them multiple times.
* | | | | | | Don't expose internal `type_casted_binds` methodRyuta Kamizono2019-03-192-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Internal usage for the method as public has removed at #29623.
* | | | | | | Added release notes for changes in Railties [ci skip] (#35622)प्रथमेश Sonpatki2019-03-182-2/+65
|/ / / / / / | | | | | | | | | | | | [Alex Kitchens, Prathamesh Sonpatki]
* | | | | | Merge pull request #35652 from razh/revert-rails-ujs-html-contentKasper Timm Hansen2019-03-182-3/+3
|\ \ \ \ \ \ | | | | | | | | | | | | | | Revert "Pass HTML responses as plain-text in rails-ujs"
| * | | | | | Add regression test for HTML content in rails-ujsrazh2019-03-171-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | See discussion in #32287
| * | | | | | Revert "Pass HTML responses as plain-text in rails-ujs"razh2019-03-172-12/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 48e44edfd0a8a7a29aa8fad39638ac0ee5243f42. See discussion in #32287 For HTML content in `ajax:success` handlers, `event.detail[0]` should be an `HTMLDocument` instance.
* | | | | | | Merge pull request #35653 from kamipo/remove_arel_nodes_valuesRyuta Kamizono2019-03-1811-74/+22
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Get rid of `Arel::Nodes::Values`
| * | | | | | | Get rid of `Arel::Nodes::Values`Ryuta Kamizono2019-03-1811-74/+22
| |/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | That is completely covered by `Arel::Nodes::ValuesList`. Related https://github.com/rails/arel/pull/484.
* | | | | | | Add test case to prevent possible SQL injectionRyuta Kamizono2019-03-183-1/+23
| | | | | | |
* | | | | | | Fix updating rich text via nested attributesGeorge Claghorn2019-03-176-7/+40
| | | | | | | | | | | | | | | | | | | | | Closes #35159.
* | | | | | | Merge pull request #35654 from t-richards/bugfix/referrer-policy-errorRyuta Kamizono2019-03-181-1/+1
|\ \ \ \ \ \ \ | |/ / / / / / |/| | | | | | Fix invalid suggestion in null origin error message
| * | | | | | Suggest 'strict-origin' Referrer-Policy headerTom Richards2019-03-171-1/+1
|/ / / / / /
* | | | | | Ruby 2.4 and later support native Unicode case mappingsRyuta Kamizono2019-03-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Here is only place where we use `mb_chars` internally.
* | | | | | Add `:reselect` and `:optimizer_hints` to the list of finder methodsRyuta Kamizono2019-03-181-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These are introduced after Rails 6.0.0 beta2. [ci skip]
* | | | | | Add test case for unscoping `:optimizer_hints`Ryuta Kamizono2019-03-183-1/+13
| | | | | |
* | | | | | Tweak `truncate_tables`Ryuta Kamizono2019-03-182-18/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Remove redundant `table_names.empty?` * Early return in `truncate_tables` since it is already deeply nested * Move `truncate_tables` out from between `exec_delete` and `exec_update`
* | | | | | SQLite3: Make fixture loading to bulk statementsRyuta Kamizono2019-03-175-53/+40
| | | | | |
* | | | | | Fix undefined local variable or method `discard_remaining_results'Ryuta Kamizono2019-03-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | https://buildkite.com/rails/rails/builds/59632#fe3d2551-569a-46c8-94f3-7abe835d4d7a/122-153
* | | | | | Ensure `execute_batch` discards remaining resultsRyuta Kamizono2019-03-172-14/+5
| | | | | |
* | | | | | Make `truncate_tables` to bulk statementsRyuta Kamizono2019-03-179-59/+123
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before: ``` (16.4ms) TRUNCATE TABLE `author_addresses` (20.5ms) TRUNCATE TABLE `authors` (19.4ms) TRUNCATE TABLE `posts` ``` After: ``` Truncate Tables (19.5ms) TRUNCATE TABLE `author_addresses`; TRUNCATE TABLE `authors`; TRUNCATE TABLE `posts` ```
* | | | | | Merge pull request #35637 from y-yagi/add_environment_option_to_initializersYuji Yaginuma2019-03-173-2/+29
|\ \ \ \ \ \ | | | | | | | | | | | | | | Add `-e/--environment` option to `rails initializers`
| * | | | | | Add -e/--environment option to `rails initializers`yuuji.yaginuma2019-03-163-2/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows specifying the environment as would any other rails commands.
* | | | | | | Fix warning: instance variable @optimizer_hints not initializedRyuta Kamizono2019-03-171-0/+1
| |_|_|_|_|/ |/| | | | | | | | | | | | | | | | | https://buildkite.com/rails/rails/builds/59622#924dff9d-85c2-4946-b264-a7e6ce01432c/122-130
* | | | | | Extract `truncate` and `truncate_tables` into database statementsRyuta Kamizono2019-03-1713-84/+42
| | | | | | | | | | | | | | | | | | | | | | | | This is to easier make `truncate_tables` to bulk statements.
* | | | | | Merge pull request #35615 from kamipo/optimizer_hintsRyuta Kamizono2019-03-1720-6/+184
|\ \ \ \ \ \ | | | | | | | | | | | | | | Support Optimizer Hints
| * | | | | | Support Optimizer HintsRyuta Kamizono2019-03-1620-6/+184
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We as Arm Treasure Data are using Optimizer Hints with a monkey patch (https://gist.github.com/kamipo/4c8539f0ce4acf85075cf5a6b0d9712e), especially in order to use `MAX_EXECUTION_TIME` (refer #31129). Example: ```ruby class Job < ApplicationRecord default_scope { optimizer_hints("MAX_EXECUTION_TIME(50000) NO_INDEX_MERGE(jobs)") } end ``` Optimizer Hints is supported not only for MySQL but also for most databases (PostgreSQL on RDS, Oracle, SQL Server, etc), it is really helpful to turn heavy queries for large scale applications.
* | | | | | | `ActiveRecord::Result#to_hash` has been renamed to `to_a` [ci skip]Ryuta Kamizono2019-03-171-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | See #33912.
* | | | | | | Merge pull request #35642 from simi/raise-on-unknown-column-during-insert-allRyuta Kamizono2019-03-172-0/+14
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Raise UnknownAttributeError when unknown column is passed to insert_all and friends
| * | | | | | | Raise UnknownAttributeError when unknown column is passed to insert_all and ↵Josef Šimánek2019-03-162-0/+14
|/ / / / / / / | | | | | | | | | | | | | | | | | | | | | friends.
* | | | | | | Merge pull request #35634 from sharang-d/update-parameterize-docsRyuta Kamizono2019-03-162-6/+10
|\ \ \ \ \ \ \ | |_|/ / / / / |/| | | | | | Update docs for 'parameterize()' [ci skip]
| * | | | | | Update docs for 'parameterize()' [ci skip]Sharang Dashputre2019-03-162-6/+10
| | | | | | |
* | | | | | | Engines are reloaded in Zeitwerk mode [closes #35618]Xavier Noria2019-03-153-16/+24
|/ / / / / /
* | | | | | Merge pull request #35628 from jhawthorn/file_update_any_extensionAaron Patterson2019-03-152-1/+15
|\ \ \ \ \ \ | | | | | | | | | | | | | | Match evented checker behavior on dir with no exts
| * | | | | | Match evented checker behavior on dir with no extsJohn Hawthorn2019-03-152-1/+15
| | |/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When FileUpdateChecker is passed a directory and given an empty array of extensions to match on, it will match any extension. Previously, EventedFileUpdateChecker would never match any files when given an empty array. This commit makes it EventedFileUpdateChecker match FileUpdateChecker, and watch all extensions when given an empty array.
* | | | | | Merge pull request #35623 from jhawthorn/actionview_cacheAaron Patterson2019-03-156-98/+13
|\ \ \ \ \ \ | | | | | | | | | | | | | | Make Template::Resolver always cache
| * | | | | | Remove updated_at from TemplatesJohn Hawthorn2019-03-154-18/+9
| | | | | | |
| * | | | | | Make Template::Resolver always cacheJohn Hawthorn2019-03-153-80/+4
| | |_|/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All actionview caches are already cleared at the start of each request (when Resolver.caching is false) by PerExecutionDigestCacheExpiry, which calls LookupContext::DetailsKey.clear (which clears all caches). Because caches are always cleared per-request in dev, we shouldn't need this extra logic to compare mtimes and conditionally reload templates. This should make templates slightly faster in development (particularly multiple renders of the same template)
* | | | | | Merge pull request #35627 from Futurelearn/seb-rename-view-run-methodAaron Patterson2019-03-153-3/+3
|\ \ \ \ \ \ | |_|/ / / / |/| | | | | Rename `ActionView::Base#run`
| * | | | | Rename `ActionView::Base#run` to `#_run`Seb Jacobs2019-03-153-3/+3
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There was a recent change by @tenderlove to Action view which introduced `ActionView::Base#run` [1]. We ran into an issue with our application because one of the core concepts in our domain model is a `Run` which is exposed in most of our views as a helper method, which now conflicts with this new method. Although this is a public method it is not really meant to be part of the public API. In order to discourage public use of this method and to reduce the chances of this method conflicting with helper methods we can prefix this method with an underscore, renaming this method to `_run`. [1] https://github.com/rails/rails/commit/c740ebdaf5
* | | | | Merge pull request #35599 from y-yagi/improve_environment_argument_handlingYuji Yaginuma2019-03-157-12/+48
|\ \ \ \ \ | |_|/ / / |/| | | | Properly expand the environment's name in all commands
| * | | | Properly expand the environment's name in all commandsyuuji.yaginuma2019-03-157-12/+48
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since 3777701f1380f3814bd5313b225586dec64d4104, the environment's name is automatically expanded in console and dbconsole commands. In order to match the behavior between the commands, fixes it to have the same behavior of all the commands. This behavior is defined in `EnvironmentArgument`. Since `EnvironmentArgument` also defines the environment option, it is reused. However, since desc was not content that can be used in all comments, fixed desc to be defined for each command.
* / / / bumps ZeitwerkXavier Noria2019-03-142-3/+3
|/ / /
* | | GCS service: skip unnecessary bucket lookupsGeorge Claghorn2019-03-141-1/+1
| | |
* | | Merge pull request #35607 from ↵Yuji Yaginuma2019-03-142-0/+4
|\ \ \ | | | | | | | | | | | | | | | | y-yagi/ensure_application_work_without_tmp_directory Make application work without tmp directory
| * | | Make application work without tmp directoryyuuji.yaginuma2019-03-142-0/+4
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The tmp directory is added to version control in the newly created application. This was added in Rails 5.0.0(https://github.com/rails/rails/commit/f06ce4c12a396795a3b2c1812951d9277bcb3a82). However, applications created before that are not guaranteed to have the tmp directory. If the tmp directory does not exist, writing to the key file raise error. This is a bit incompatible. So I fixed that create the directory before writing a key.
* | | Merge pull request #35605 from richardmonette/support-slice-assign-safe-bufferRafael França2019-03-132-2/+38
|\ \ \ | | | | | | | | support slice assignment on SafeBuffer
| * | | support slice assignment on SafeBufferRichard Monette2019-03-132-2/+38
| | | |
* | | | Fix secret_key_base for Railtieseileencodes2019-03-132-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | This was missed in the security fix for local dev. CI doesn't have a tmp directory in the apps built for testing so these end up failing. This adds the secret_key_base so we don't need to generate one.