aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | | Remove unnecessary reduce in Duration#inspectDaniel Colson2018-11-241-1/+0
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the `Duration` class was introduced in 276c9f29, the `parts` were represented as an array of arrays (for example `[[:seconds, 5], [:days, 3], [:seconds, 7]]`). At that time the `reduce` in `#inspect` made sense, since we would need to get the totals for each part (the example would become `{ seconds: 12, days: 3 }`). With the current version of `Duration` we call `to_h` on the `parts` immediately on initialize, so now the `reduce` doesn't seem to be doing anything meaningful.
* | | | Merge pull request #34517 from EByrdS/immutable-enumRafael França2018-11-233-0/+19
|\ \ \ \ | | | | | | | | | | Pluralized enum raises error when attempting to modify
| * | | | Raises error when attempting to modify enum valuesebyrds2018-11-233-0/+19
| | | | |
* | | | | Merge pull request #34515 from BenjaminKim/patch-1Rafael França2018-11-231-1/+1
|\ \ \ \ \ | |/ / / / |/| | | | rubyonrails.org has been ready for https
| * | | | rubyonrails.org has been ready for httpsBenjamin Kim2018-11-241-1/+1
|/ / / /
* | | | Merge pull request #34376 from composerinteralia/default_queue_nameRafael França2018-11-232-2/+29
|\ \ \ \ | | | | | | | | | | Allow using queue prefix with a default queue name
| * | | | Allow using queue prefix with a default queue nameDaniel Colson2018-11-032-2/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes #34366 Currently setting queue_name_prefix will not combine a prefix with the default_queue_name; it will only affect queue names set with `queue_as`. With this PR the prefix will affect the default_queue_name as well. Closes #19831 Currently setting default_queue_name doesn't actually affect the queue_name default (although default_queue_name does get used if you pass a falsey `part_name` to `queue_as`). This PR would get default_queue_name working as expected as well. Because the queue_name default is now a lambda wrapping the default_queue_name, rather than the default_queue_name itself, I had to update one test to use the instance method `#queue_name` (which `instance_exec`s the value) instead of the class method. I think this change is OK, since only the instance method is documented. There was a question about whether we want a `default_queue_name` configuration. If we want to get rid of it, I would also be happy to open a PR for that instead. It has been around for a while now, but it also hasn't really worked for a while now. r? @matthewd since you had an opinion about this before
* | | | | Merge pull request #34367 from gmcgibbon/rm_parameterized_delivery_jobRafael França2018-11-239-51/+50
|\ \ \ \ \ | | | | | | | | | | | | Deliver parameterized mail with DeliveryJob
| * | | | | Deliver parameterized mail with DeliveryJobGannon McGibbon2018-11-229-51/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Deliver parameterized mail with `ActionMailer::DeliveryJob` and remove `ActionMailer::Parameterized::DeliveryJob`.
* | | | | | Merge pull request #34455 from ↵Rafael França2018-11-233-1/+6
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | minimalweb/progressive_jpeg_inclusion_as_variable_content_type Add progressive JPG MIME-type to default variable content types
| * | | | | | Add progressive JPG to default variable content typesMaurice Kühlborn2018-11-213-1/+6
| | | | | | |
* | | | | | | Merge pull request #34468 from gmcgibbon/redact_sql_in_errorsRafael França2018-11-239-58/+112
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Redact SQL in errors
| * | | | | | | Redact SQL in errorsGannon McGibbon2018-11-229-58/+112
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move `ActiveRecord::StatementInvalid` SQL to error property. Also add bindings as an error property.
* | | | | | | | Keep executions for each specific exception (#34352)Alberto Almagro2018-11-235-4/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Keep executions for each specific declaration Fixes #34337 ActiveJob used the global executions counter to control the number of times a job should be retried. The problem with this approach was that in case a job raised different exceptions during its executions they weren't retried the number of times defined by their `attemps` number. **Example:** Having the following job: ```ruby class BuggyJob < ActiveJob::Base retry_on CustomException, attemps: 3 retry_on OtherException, attempts: 3 end ``` If the job raised `CustomException` in the first two executions and then it raised `OtherException`, the job wasn't retried anymore because the global executions counter was already indicating 3 attempts. With this patch each `retry_on` declaration has its specific counter so that the first two executions that raise `CustomException` don't affect the retries count that future exceptions may have. * Revert "clarifies documentation around the attempts arugment to retry_on" This reverts commit 86aa8f8c5631f77ed9a208e5107003c01512133e.
* | | | | | | | Merge pull request #34507 from albertoalmagro/rename-rtl-as-directionGannon McGibbon2018-11-232-18/+21
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | Use direction instead of rtl flag
| * | | | | | | | Use direction instead of rtl flag.Alberto Almagro2018-11-222-18/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Improve readability by using `direction` as CSS does. More info: https://developer.mozilla.org/en-US/docs/Web/CSS/direction Continues: #34486 [Alberto Almagro + Ufuk Kayserilioglu]
* | | | | | | | | Merge pull request #34511 from TomSpencerLondon/masterGannon McGibbon2018-11-231-1/+1
|\ \ \ \ \ \ \ \ \ | |_|_|_|/ / / / / |/| | | | | | | | Add ? for Whats Rails
| * | | | | | | | Add ? for Whats RailsTomSpencerLondon2018-11-231-1/+1
|/ / / / / / / /
* | | | | | | | Merge pull request #34037 from reitermarkus/atomic_write-permissionsRafael França2018-11-222-1/+15
|\ \ \ \ \ \ \ \ | |/ / / / / / / |/| | | | | | | `atomic_write`: Ensure correct permission when `tmpdir` is the same as `dirname`.
| * | | | | | | Ensure correct permission when `tmpdir` is the same as `dirname`.Markus Reiter2018-10-022-1/+15
| | | | | | | |
* | | | | | | | Use squiggly heredoc to strip odd indentation in the executed SQLRyuta Kamizono2018-11-2219-91/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before: ``` LOG: execute <unnamed>: SELECT t.oid, t.typname FROM pg_type as t WHERE t.typname IN ('int2', 'int4', 'int8', 'oid', 'float4', 'float8', 'bool') LOG: execute <unnamed>: SELECT t.oid, t.typname, t.typelem, t.typdelim, t.typinput, r.rngsubtype, t.typtype, t.typbasetype FROM pg_type as t LEFT JOIN pg_range as r ON oid = rngtypid WHERE t.typname IN ('int2', 'int4', 'int8', 'oid', 'float4', 'float8', 'text', 'varchar', 'char', 'name', 'bpchar', 'bool', 'bit', 'varbit', 'timestamptz', 'date', 'money', 'bytea', 'point', 'hstore', 'json', 'jsonb', 'cidr', 'inet', 'uuid', 'xml', 'tsvector', 'macaddr', 'citext', 'ltree', 'interval', 'path', 'line', 'polygon', 'circle', 'lseg', 'box', 'time', 'timestamp', 'numeric') OR t.typtype IN ('r', 'e', 'd') OR t.typinput::varchar = 'array_in' OR t.typelem != 0 LOG: statement: SHOW TIME ZONE LOG: statement: SELECT 1 LOG: execute <unnamed>: SELECT COUNT(*) FROM pg_class c LEFT JOIN pg_namespace n ON n.oid = c.relnamespace WHERE c.relkind IN ('r','v','m') -- (r)elation/table, (v)iew, (m)aterialized view AND c.relname = 'accounts' AND n.nspname = ANY (current_schemas(false)) ``` After: ``` LOG: execute <unnamed>: SELECT t.oid, t.typname FROM pg_type as t WHERE t.typname IN ('int2', 'int4', 'int8', 'oid', 'float4', 'float8', 'bool') LOG: execute <unnamed>: SELECT t.oid, t.typname, t.typelem, t.typdelim, t.typinput, r.rngsubtype, t.typtype, t.typbasetype FROM pg_type as t LEFT JOIN pg_range as r ON oid = rngtypid WHERE t.typname IN ('int2', 'int4', 'int8', 'oid', 'float4', 'float8', 'text', 'varchar', 'char', 'name', 'bpchar', 'bool', 'bit', 'varbit', 'timestamptz', 'date', 'money', 'bytea', 'point', 'hstore', 'json', 'jsonb', 'cidr', 'inet', 'uuid', 'xml', 'tsvector', 'macaddr', 'citext', 'ltree', 'interval', 'path', 'line', 'polygon', 'circle', 'lseg', 'box', 'time', 'timestamp', 'numeric') OR t.typtype IN ('r', 'e', 'd') OR t.typinput::varchar = 'array_in' OR t.typelem != 0 LOG: statement: SHOW TIME ZONE LOG: statement: SELECT 1 LOG: execute <unnamed>: SELECT COUNT(*) FROM pg_class c LEFT JOIN pg_namespace n ON n.oid = c.relnamespace WHERE c.relkind IN ('r','v','m') -- (r)elation/table, (v)iew, (m)aterialized view AND c.relname = 'accounts' AND n.nspname = ANY (current_schemas(false)) ```
* | | | | | | | Compile packs before run testyuuji.yaginuma2018-11-221-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sometimes `test_scaffold_tests_pass_by_default` test fails in CI. https://travis-ci.org/rails/rails/jobs/457621750#L2095-L2120 It seems `manifest.json` was broken. `webpacker` will compile automatically if packs is not compiled. If parallel test is enabled, it seems that this compilation process is executed simultaneously in multiple processes, and it may become an inconsistent state. In order to avoid this, compile before running the test.
* | | | | | | | Fix ruby warningsyuuji.yaginuma2018-11-221-2/+2
| |/ / / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes following warnings: ``` test/dependencies_test.rb:287: warning: possibly useless use of :: in void context test/dependencies_test.rb:300: warning: possibly useless use of a constant in void context ```
* | | | | | | Merge pull request #34339 from Edouard-chin/ec-mail-test-helperRafael França2018-11-217-9/+171
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Fix ActionMailer assertion not working for mail defining delivery_job:
| * | | | | | | Fix ActionMailer assertion not working for mail defining delivery_job:Edouard CHIN2018-11-213-5/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - If a Mail defines a custom delivery_job, all ActionMailer assertion helper (assert_emails, assert_enqueued_emails ...) wouldn't work. ```ruby MyMailer < ApplicationMailer self.delivery_job = MyJob end # This assertion will fail assert_emails(1) do MyMailer.my_mail.deliver_later end This PR leverage the new ActiveJob feature that accepts Procs for the `only` keyword and check if the delivery job is one of ActionMailer registered ones.
| * | | | | | | Allow all ActiveJob assertion helper to accept Proc in their `only` kw:Edouard CHIN2018-11-214-4/+101
|/ / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - That feature is useful to enqueue or assert that jobs got enqueued or performed based on dynamic conditions. We will be able to leverage that feature to fix all ActionMailer assertion helper issue when a Mailer define a custom delivery job (see next commit).
* | | | | | | Merge pull request #34498 from ThomBian/thombian/fix-opclass-parsingRyuta Kamizono2018-11-222-1/+13
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Fixing an issue when parsing an opclass by allowing indexed column in indexdef to be wrapped up by double quotes
| * | | | | | | Fixing an issue when parsing an opclass by allowing indexed columnThomas Bianchini2018-11-212-1/+13
|/ / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | in indexdef to be wrapped up by double quotes Fixes #34493. *Thomas Bianchini*
* | | | | | | Merge pull request #34491 from rails/fix-query-cache-on-multiple-connectionsEileen M. Uchitelle2018-11-212-4/+27
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Fix query cache for multiple connections
| * | | | | | | Fix query cache for multiple connectionsEileen Uchitelle2018-11-202-4/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the query cache is only aware of one handler so once we added multiple databases switching on the handler we broke query cache for those reading connections. While #34054 is the proper fix, that fix is not straight forward and I want to make sure that the query cache isn't just broken for all other connections not in the main handler.
* | | | | | | | Remove odd spaces [ci skip]Ryuta Kamizono2018-11-211-2/+2
| | | | | | | |
* | | | | | | | Merge pull request #34489 from 6temes/add_slice_method_to_errorsRafael França2018-11-213-0/+39
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | Add slice! method to ActiveModel::Errors
| * | | | | | | | Add slice! method to ActiveModel::ErrorsDaniel Lopez Prat2018-11-213-0/+39
| | | | | | | | |
* | | | | | | | | Merge pull request #34497 from 6temes/make_documentation_for_slice_more_explicitRafael França2018-11-201-2/+3
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | Expand documentation for Hash#slice!
| * | | | | | | | | Improve documentation for Hash#slice!Daniel Lopez 👾2018-11-211-2/+3
| |/ / / / / / / /
* | | | | | | | | Merge pull request #34495 from ↵Eileen M. Uchitelle2018-11-202-2/+39
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | rails/make-connection-handler-per-thread-not-per-fiber Make connection handler per thread instead of per fiber
| * | | | | | | | | Make connection handler per thread instead of per fiberEileen Uchitelle2018-11-202-2/+39
| | |/ / / / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The connection handler was using the RuntimeRegistry which kind of implies it's a per thread registry. But it's actually per fiber. If you have an application that uses fibers and you're using multiple databases, when you switch the connection handler to swap connections new fibers running on the same thread used to get a different connection id. This PR changes the code to actually use a thread so that we get the same connection. Fixes https://github.com/rails/rails/issues/30047 [Eileen M. Uchitelle, Aaron Patterson, & Arthur Neeves]
* | | | | | | | | Merge pull request #34494 from gmcgibbon/warn_root_conflictRafael França2018-11-203-7/+22
|\ \ \ \ \ \ \ \ \ | |/ / / / / / / / |/| | | | | | | | Stop using unnamed roots on conflict
| * | | | | | | | Raise an error on root route naming conflicts.Gannon McGibbon2018-11-203-7/+22
|/ / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Raises an ArgumentError when multiple root routes are defined in the same context instead of assigning nil names to subsequent roots.
* | | | | | | | Merge pull request #33954 from ↵Aaron Patterson2018-11-204-3/+43
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | febeling/inconsistent-assignment-has-many-through-33942 Fix handling of duplicates for `replace` on has_many-through
| * | | | | | | | Optimize difference and intersectionFlorian Ebeling2018-11-061-17/+9
| | | | | | | | |
| * | | | | | | | Rename union to intersectionFlorian Ebeling2018-11-063-3/+3
| | | | | | | | |
| * | | | | | | | Fix handling of duplicates for `replace` on has_many-throughFlorian Ebeling2018-11-064-3/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There was a bug in the handling of duplicates when assigning (replacing) associated records, which made the result dependent on whether a given record was associated already before being assigned anew. E.g. post.people = [person, person] post.people.count # => 2 while post.people = [person] post.people = [person, person] post.people.count # => 1 This change adds a test to provoke the former incorrect behavior, and fixes it. Cause of the bug was the handling of record collections as sets, and using `-` (difference) and `&` (union) operations on them indiscriminately. This temporary conversion to sets would eliminate duplicates. The fix is to decorate record collections for these operations, and only for the `has_many :through` case. It is done by counting occurrences, and use the record together with the occurrence number as element, in order to make them work well in sets. Given a, b = *Person.all then the collection used for finding the difference or union of records would be internally changed from [a, b, a] to [[a, 1], [b, 1], [a, 2]] for these operations. So a first occurrence and a second occurrence would be distinguishable, which is all that is necessary for this task. Fixes #33942.
* | | | | | | | | Merge pull request #34492 from alfonsojimenez/fix-typoVipul A M2018-11-201-1/+1
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | Fix typo in development_dependencies_install.md [ci skip]
| * | | | | | | | | Fix typo in development_dependencies_install.md [ci skip]Alfonso Jiménez2018-11-201-1/+1
|/ / / / / / / / /
* | | | | | | | | Deprecate `event.end = Time.now` in favor of `event.finish!`Ryuta Kamizono2018-11-201-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since #33449, `event.end = Time.now` is not used anymore and should use `event.finish!`. We can't use `deprecate :end=` in definition time in this module due to circular require in `active_support/deprecation/behaviors`.
* | | | | | | | | Merge pull request #22534 from evopark/masterRafael Mendonça França2018-11-194-3/+26
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ActionMailer: support overriding template name in multipart
| * | | | | | | | | ActionMailer: support overriding template name in multipartMarcus Ilgner2015-12-084-3/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implicit rendering in multipart blocks now also uses the template name from the options hash instead of always using the action name. So you can now write mail(template_name: template_name) do |format| format.text format.html end
* | | | | | | | | | Merge pull request #20865 from colavitam/only-except-behaviorRafael Mendonça França2018-11-192-2/+30
|\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | :only and :except are now chained for routing resource(s)
| * | | | | | | | | | :only and :except are now chained for routing resource(s)Michael Colavita2015-07-133-3/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow chaining the :only and :except options for routing resource(s). Previously, the following yielded routes for both show and destroy: resource :account, :only => [:show, :destroy], :except => :destroy This now yields only the show action. This chaining can be useful for passing optional :except options to code that makes use of the :only option (e.g. for a gem with its own routing methods).