aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | | | | | Minor changes to deprecation warning message after 35242Abhay Nikam2019-02-153-6/+6
| | | | | | | |
* | | | | | | | Merge pull request #35268 from abhaynikam/35252-add-delegate-for-path-for-methodGeorge Claghorn2019-02-142-1/+5
|\ \ \ \ \ \ \ \ | |/ / / / / / / |/| | | | | | | Fixes missing method `path_for` when using MirrorService with DiskService as the primary service
| * | | | | | | Delegated path_for to primary in the MirrorServiceAbhay Nikam2019-02-142-1/+5
| | | | | | | |
* | | | | | | | Merge pull request #35242 from ↵Eileen M. Uchitelle2019-02-143-49/+141
|\ \ \ \ \ \ \ \ | |/ / / / / / / |/| | | | | | | | | | | | | | | | | | | | | | | eileencodes/add-setter-and-deprecation-for-configurations-hashes Add setter and deprecation for configurations hashes
| * | | | | | | Improve errors and handling of hashes for database configurationseileencodes2019-02-143-49/+141
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In chat Sam Saffron asked how to use the setter now that configurations is no longer a hash and you need to do AR::Base.configurations["test"]=. Technically you can do `ActiveRecord::Base.configurations = { the hash }` but I realized the old way throws an error and is unintuitive. To aid in the transition from hashes to objects this PR makes a few changes: 1) Re-adds a deprecated hash setter `[]=` that will add a new hash to the configurations list OR replace an existing hash if that environment is already present. This won't be supported in future Rails versions but a good error is important. 2) Changed to throw deprecation warnings on the methods we decided to support for hash conversion and raise on the methods we don't support. 3) Refactored the setter/getter hash deprecation warnings messages and rewrote them. Getters message: ``` DEPRECATION WARNING: `ActiveRecord::Base.configurations` no longer returns a hash. Methods that act on the hash like `values` are deprecated and will be removed in Rails 6.1. Use the `configs_for` method to collect and iterate over the database configurations. ``` Setter message: ``` DEPRECATION WARNING: Setting `ActiveRecord::Base.configurations` with `[]=` is deprecated. Use `ActiveRecord::Base.configurations=` directly to set the configurations instead. ``` 4) Rewrote the legacy configurations test file to test all the public methods in the DatabaseConfigurations class.
* | | | | | | | Register new autoloading in AS CHANGELOG [ci skip]Xavier Noria2019-02-141-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is too much to say about it for a CHANGELOG entry, and linking to the original PR could mislead if there are later changes as already happened with the gem dependency, so just a one-liner. For final we'll up to date documentation.
* | | | | | | | Merge pull request #35261 from rails/zeitwerk-as-dependencyXavier Noria2019-02-137-25/+13
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | Let Zeitwerk be a dependency of Active Support
| * | | | | | | | Let Zeitwerk be a dependency of Active SupportXavier Noria2019-02-137-25/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Zeitwerk is a strong dependency, planned to replace AS::Dependencies. A line in the generated Gemfile does not convey this as much.
* | | | | | | | | Merge pull request #35266 from ricardotk002/use-dir-childrenRyuta Kamizono2019-02-142-11/+4
|\ \ \ \ \ \ \ \ \ | |_|_|_|_|/ / / / |/| | | | | | | | Use Dir#children and Dir#each_child in ActiveSupport::Cache::FileStore
| * | | | | | | | Use Dir#children and Dir#each_child instead of excluding "." and ".."Ricardo Díaz2019-02-132-11/+4
| | |_|_|_|/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Both methods were introduced in Ruby 2.5 and fit this use case very nicely: listing a directory's entries excluding the "." and ".." nodes. The private method #exclude_from was removed as it no longer serves its original purpose.
* / | | | | | | Add test for `csp_meta_tag`yuuji.yaginuma2019-02-141-0/+31
|/ / / / / / /
* | | | | | | Merge pull request #35238 from gwincr11/cg-active-job-queue-timeRafael Mendonça França2019-02-134-2/+20
|\ \ \ \ \ \ \ | |_|_|_|/ / / |/| | | | | | | | | | | | | Adding enque time tracking and logging
| * | | | | | Adding enque time tracking and loggingCory Gwin @gwincr112019-02-134-2/+20
|/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Motivation: - Currently we have 2 seperate monkey patches in place for tracking enqueded time for 2 seperate workers. It seems that activejob could be a source of truth for how long an item has been enqued so that we can easily use it for consistent monitoring across workers/apps to ensure that jobs are running at an acceptable speed. Changes: - Add an enqueded at attribute and serilization tooling. - Add a method to get how long a job has been enqueded for. - Add a logging item to show how long a job was enqued prior to the perform method firing.
* | | | | | Merge pull request #35258 from kamipo/revert_32380Ryuta Kamizono2019-02-146-15/+7
|\ \ \ \ \ \ | | | | | | | | | | | | | | Revert "Chaining named scope is no longer leaking to class level querying methods"
| * | | | | | Revert "Chaining named scope is no longer leaking to class level querying ↵Ryuta Kamizono2019-02-146-15/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | methods" This reverts #32380, since this may cause that silently leaking information when people upgrade the app. We need deprecation first before making this.
* | | | | | | Merge pull request #35253 from rails/cached-collections-must-have-a-templateAaron Patterson2019-02-132-3/+22
|\ \ \ \ \ \ \ | |_|/ / / / / |/| | | | | | Cached collections only work if there is one template
| * | | | | | Cached collections only work if there is one templateAaron Patterson2019-02-132-3/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Cached collections only work if there is one template. If there are more than one templates, the caching mechanism doesn't have a key.
* | | | | | | Refactors a loopXavier Noria2019-02-131-6/+8
| |/ / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I believe the current style does not clearly communicate that we are ignoring non-existing autoload paths altogether. Your eyes may even be looking for an else clause that is easy to miss but that does not exist. With the early `next` and code comment the loop reads better for my taste.
* | | | | | Merge pull request #35255 from kamipo/fix_useless_assignmentRafael França2019-02-132-5/+1
|\ \ \ \ \ \ | | | | | | | | | | | | | | Address to useless assignment `formats = nil` after #35254
| * | | | | | Address to useless assignment `formats = nil` after #35254Ryuta Kamizono2019-02-142-5/+1
|/ / / / / / | | | | | | | | | | | | | | | | | | https://codeclimate.com/github/rails/rails/pull/35254
* | | | | | Merge pull request #35254 from abhaynikam/35229-some-minor-cleanupAaron Patterson2019-02-131-2/+2
|\ \ \ \ \ \ | | | | | | | | | | | | | | Clean for fix done in #35229. Removed unused arguments for `build_lookup_context `
| * | | | | | Clean for fix done in #35229. Removed unused argumentsAbhay Nikam2019-02-131-2/+2
|/ / / / / /
* | | | | | Merge pull request #35229 from rails/fix-35222Aaron Patterson2019-02-1319-29/+111
|\ \ \ \ \ \ | | | | | | | | | | | | | | Convert lookup context's to a stack for fixing #35222 and #34138
| * | | | | | Turn lookup context in to a stack, push and pop if formats changeAaron Patterson2019-02-119-29/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit keeps a stack of lookup contexts on the ActionView::Base instance. If a format is passed to render, we instantiate a new lookup context and push it on the stack, that way any child calls to "render" will use the same format information as the parent. This also isolates "sibling" calls to render (multiple calls to render in the same template). Fixes #35222 #34138
| * | | | | | Adding another failing test caseAaron Patterson2019-02-1111-6/+39
| | | | | | |
| * | | | | | Add a failing test for #35222Aaron Patterson2019-02-115-0/+14
| |/ / / / /
* | | | | | Merge pull request #35244 from palkan/fix/activerecord-database-uri-resolveEileen M. Uchitelle2019-02-132-1/+11
|\ \ \ \ \ \ | | | | | | | | | | | | | | Fix database configurations building when DATABASE_URL present
| * | | | | | Fix database configurations building when DATABASE_URL presentVladimir Dementyev2019-02-122-1/+11
| | | | | | |
* | | | | | | Don’t log recipients when sending mailJaap van der Plas2019-02-135-10/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since production applications typically run with log level info and email adresses should be considered as sensitive data we want to prevent them from ending up in the logs. In development mode (with log level debug) they are still logged as part of the Mail::Message object.
* | | | | | | Revert "Merge pull request #35127 from bogdan/counter-cache-loading"Ryuta Kamizono2019-02-133-47/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit eec3e28a1abf75676dcee58308ee5721bb53c325, reversing changes made to 5588fb4802328a2183f4a55c36d6703ee435f85c. Reason: Marking as loaded without actual loading is too greedy optimization. See more context #35239. Closes #35239. [Edouard CHIN & Ryuta Kamizono]
* | | | | | | Support running AR isolated tests in parallelMatthew Draper2019-02-131-4/+35
| |_|_|/ / / |/| | | | |
* | | | | | Merge pull request #35034 from sponomarev/chore/ac-docs-worker-poolEileen M. Uchitelle2019-02-122-5/+18
|\ \ \ \ \ \ | | | | | | | | | | | | | | Add Worker Pool section to Action Cable configuration docs
| * | | | | | Add Worker Pool section to Action Cable configuration docsSergey Ponomarev2019-02-012-5/+18
| | | | | | |
* | | | | | | Merge pull request #34714 from palkan/chore/refactor-action-cable-server-configKasper Timm Hansen2019-02-133-11/+29
|\ \ \ \ \ \ \ | |_|/ / / / / |/| | | | | | Action Cable: allow multiple instances of Server::Base with different configs
| * | | | | | Allow passing custom config to ActionCable::Server::BaseVladimir Dementyev2019-02-123-11/+29
|/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | That allows us to create a separate, isolated Action Cable server instance within the same app.
* | | | | | Should respect attribute_types over column_typesRyuta Kamizono2019-02-131-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | Fixed the CI failure https://travis-ci.org/rails/rails/jobs/492291248#L1185-L1191.
* | | | | | Merge pull request #35237 from eileencodes/fix-teardown-in-db-selector-testEileen M. Uchitelle2019-02-121-0/+4
|\ \ \ \ \ \ | | | | | | | | | | | | | | Fix DatabaseSelector test that fails sometimes
| * | | | | | Fix DatabaseSelector test that fails sometimeseileencodes2019-02-121-0/+4
| | |_|/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On CI we've seen a few test failures when the DatabaseSelectorTest runs before the ConnectionHandlersMultiDbTest. This is because it's creating 2 handlers but not properly tearing them down. Example failure: ``` Failure: ActiveRecord::ConnectionAdapters::ConnectionHandlersMultiDbTest#test_connects_to_with_single_configuration [/rails/activerecord/test/cases/connection_adapters/connection_handlers_multi_db_test.rb:241]: Expected: 1 Actual: 2 ```
* | | | | | Fix `pluck` and `select` with custom attributesRyuta Kamizono2019-02-1310-16/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently custom attributes are always qualified by the table name in the generated SQL wrongly even if the table doesn't have the named column, it would cause an invalid SQL error. Custom attributes should only be qualified if the table has the same named column.
* | | | | | Merge pull request #35235 from rails/fxn/zeitwerkXavier Noria2019-02-1217-66/+385
|\ \ \ \ \ \ | | | | | | | | | | | | | | Zeitwerk integration
| * | | | | | styleXavier Noria2019-02-122-3/+5
| | | | | | |
| * | | | | | Zeitwerk integrationXavier Noria2019-02-1217-66/+383
| | | | | | |
* | | | | | | Merge pull request #35175 from drn/create-sessionGuillermo Iguaran2019-02-122-1/+28
|\ \ \ \ \ \ \ | |/ / / / / / |/| | | | | | Support testing of non-ActionDispatch-routed apps.
| * | | | | | Support testing of non-ActionDispatch-routed apps.Darren Cheng2019-02-052-1/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The [Grape API framework](https://github.com/ruby-grape/grape) regularly writes tests like [spec/grape/api_spec.rb](https://github.com/ruby-grape/grape/blob/master/spec/grape/api_spec.rb). When attempting to write a test in a Rails environment similar to the following: ``` describe Grape::Api, type: :request do let(:app) { Class.new(Grape::API) do get 'test' do { foo: 'bar' } end end } it '200s' do get 'test' end end ``` The following exception is thrown: ``` NoMethodError: undefined method `url_helpers' for #<Array:0x00007fb4e4bc4c88> -- 0: .../lib/action_dispatch/testing/integration.rb:330:in `block in create_session' 1: .../lib/action_dispatch/testing/integration.rb:326:in `initialize' 2: .../lib/action_dispatch/testing/integration.rb:326:in `new' 3: .../lib/action_dispatch/testing/integration.rb:326:in `create_session' 4: .../lib/action_dispatch/testing/integration.rb:316:in `integration_session' 5: .../lib/action_dispatch/testing/integration.rb:348:in `block (2 levels) in <module:Runner>' ``` This change explicitly ensures that `app.routes` is an `ActionDispatch::Routing::RouteSet` instance.
* | | | | | | Add missing packages (#35227)Yuji Yaginuma2019-02-121-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | If generate application without specified options,`actioncable` and `activestorage` loads by default.
* | | | | | | Merge pull request #32861 from zvkemp/asn-unsubscribe-proxyAaron Patterson2019-02-115-3/+100
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | use ProxyPattern to match for ActiveSupport::Notifications fanout/unsubscribe
| * | | | | | | use a proxy matcher for AS::N fanoutzvkemp2019-02-115-3/+100
| | | | | | | |
* | | | | | | | Merge pull request #35226 from olivierlacan/docs/active-job-queue-as-blockRafael França2019-02-111-0/+20
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | Document queue_as block arguments and their use
| * | | | | | | | Document queue_as block arguments and their useOlivier Lacan2019-02-111-0/+20
|/ / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, we only document the use case for ActiveJob's `queue_as` block arguments in [Rails Guides][1]. It seems necessary to document them in the API docs as well considering how useful and powerful this option is. [1]: https://edgeguides.rubyonrails.org/active_job_basics.html#queues [ci skip]
* | | | | | | | Avoid implicit delegation in the migration compatibilityRyuta Kamizono2019-02-121-12/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The implicit delegation in the migration class is to be logged. It is not intended in the migration compatibility, so it should be avoided. Fixes #35224.