aboutsummaryrefslogtreecommitdiffstats
path: root/activejob
Commit message (Collapse)AuthorAgeFilesLines
* ActiveJob::Base no longer dependents on Serializersalpaca-tc2018-07-032-2/+0
|
* Revert "Merge pull request #33234 from alpaca-tc/autoload_activejob_arguments"Kasper Timm Hansen2018-07-013-1/+3
| | | | | | | | | | | It breaks Active Job when run in isolation. E.g. bin/test test/cases/logging_test.rb: https://travis-ci.org/rails/rails/jobs/398779028 Consider Rafaels suggestion of reviewing the eager loading instead: https://github.com/rails/rails/pull/33234#issuecomment-401027419 This reverts commit cb0fdaacb277bd0595bfd73178329922aa24477e, reversing changes made to a0a1abb3c7942084111d87ae95837a83bcc794f6.
* Allow `queue` option to `assert_no_enqueued_jobs`bogdanvlviv2018-06-303-2/+96
| | | | | | | | | | | It can be asserted that no jobs are enqueued to a specific queue: ```ruby def test_no_logging assert_no_enqueued_jobs queue: 'default' do LoggingJob.set(queue: :some_queue).perform_later end end ```
* Merge pull request #33257 from utilum/ruby-warningsRyuta Kamizono2018-06-302-4/+6
|\ | | | | Fix Ruby warnings tickled by the test suite
| * Fix Ruby warnings tickled by the test suiteutilum2018-06-302-4/+6
| |
* | Clarify activejob/lib/active_job/test_helper.rbbogdanvlviv2018-06-292-4/+10
|/ | | | | | | | | | | Rename `in_block_job` to `enqueued_job` since this variable can refer not only to jobs that were created in the block. See #33258. Return back accidentally removed test to activejob/test/cases/test_helper_test.rb See #33258. Fix name of tests.
* Allow call `assert_enqueued_with` and `assert_enqueued_email_with` with no blockbogdanvlviv2018-06-293-14/+114
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Example of `assert_enqueued_with` with no block ```ruby def test_assert_enqueued_with MyJob.perform_later(1,2,3) assert_enqueued_with(job: MyJob, args: [1,2,3], queue: 'low') MyJob.set(wait_until: Date.tomorrow.noon).perform_later assert_enqueued_with(job: MyJob, at: Date.tomorrow.noon) end ``` Example of `assert_enqueued_email_with` with no block: ```ruby def test_email ContactMailer.welcome.deliver_later assert_enqueued_email_with ContactMailer, :welcome end def test_email_with_arguments ContactMailer.welcome("Hello", "Goodbye").deliver_later assert_enqueued_email_with ContactMailer, :welcome, args: ["Hello", "Goodbye"] end ``` Related to #33243
* Revert "Merge pull request #33243 from ↵Rafael Mendonça França2018-06-281-1/+1
| | | | | | | | | evopark/fix/action-mailer-test-helper-no-block" This reverts commit 9d6bbf4e0b2d2b2e2fccd87a778de2893bb28a25, reversing changes made to 5a1ea09062eaed78e21253a128d433a1beb745ad. This method only works with block.
* Fix ActionMailer assert_enqueued_email_withMarcus Ilgner2018-06-281-1/+1
| | | | | | The documentation for assert_enqueued_email_with states that it's supposed to work without a block yet it calls assert_enqueued_with which doesn't check whether a block was passed before calling `yield`
* Autoload ActiveJob::Argumentsalpaca-tc2018-06-271-0/+1
|
* ActiveJob::Arguments is no longer used in filealpaca-tc2018-06-272-3/+0
|
* Add changelog entry for 3110cae [ci skip]bogdanvlviv2018-06-271-0/+4
| | | | | | | Since it is changes of the public API, it seems valuable to add a mention about it to the changelog file. Follow up 3110caecbebdad7300daaf26bfdff39efda99e25
* Allow passing multiple exceptions to retry_on/discard_onGeorge Claghorn2018-06-253-7/+32
|
* Fix name of the second parameter of block executed by `discard_on` and ↵bogdanvlviv2018-05-291-4/+4
| | | | | | | | `retry_on` [ci skip] Follow up #32854 and ba07b5fc12a740d41d288bea6347f15f4948483c.
* update README link: md instead rdoc [ci skip]Oscar Amado2018-05-241-1/+1
|
* correct link to activejob readme [ci skip]Oscar Amado2018-05-241-1/+1
|
* Enable warnings in all test tasksutilum2018-05-231-2/+2
| | | | Also normalize AJ task use t, like all other Rails test tasks.
* Rename exception variable to error.Kasper Timm Hansen2018-05-211-2/+2
| | | | Follows the change from 6fac9bd, so the naming is consistent.
* Pass the error instance as the second parameter of block executed by ↵yuuji.yaginuma2018-05-124-3/+9
| | | | | | | | | | | `discard_on` I'm not sure what originally wanted to pass to the argument. However, as long as see the document added along with the commit, it seems just to be mistaken that trying to pass the error instance. https://github.com/rails/rails/pull/30622/files#diff-59beb0189c8c6bc862edf7fdb84ff5a7R64 Fixes #32853
* Make sure that when serialing an just deserialized job arguments are thereRafael Mendonça França2018-05-012-10/+22
| | | | | | | | | | | | | When a job was just deserialized `arguments` is `nil` and the serialized arguments are in the `@serialized_arguments` variable. If we try to serialize this job again the arguments are going to be `nil` instead of what was serialized. The test we had was not checking this case because it was deserializing the job in the same object that had the arguments. To fix this, when the `@serialized_arguments` are present we return it instead of the result of the `arguments` serialized.
* Strip duplicated suffixes more strictlyRyuta Kamizono2018-04-221-1/+1
| | | | In the previous code incorrectly removes intermediate words.
* Fix duplicated suffix for JobGeneratorYoshiyuki Hirano2018-04-221-0/+4
|
* fix spelling in docs for ActiveJob::Serializers::ObjectSerializer#deserializeJared Rader2018-04-131-1/+1
|
* Remove support for Qu gem.Alberto Almagro2018-03-197-96/+9
| | | | | | Reasons are that the Qu gem wasn't compatible since Rails 5.1, gem development was stopped in 2014 and maintainers have confirmed its demise. See issue #32273
* Add documentation about not accepting PRs for new adapters (#32298)Jeremy Green2018-03-192-0/+7
|
* Remove changelog header for unreleased versionRafael Mendonça França2018-03-131-2/+0
| | | | | | We only add the header when releasing to avoid some conflicts. [ci skip]
* Fix CHANGELOGs [ci skip]bogdanvlviv2018-03-121-1/+1
| | | | | | | | - Add missing dots. - Remove reference to itself on GitHub. Usually, we add references to fixed issues only in a changelog. Follow up #32223
* Remove passing extra arguments to ActiveJob Callbacksbogdanvlviv2018-02-233-4/+4
|
* Add support for timezones to Active JobAndrew White2018-02-2210-1/+103
| | | | | | Record what was the current timezone in effect when the job was enqueued and then restore when the job is executed in same way that the current locale is recorded and restored.
* Merge pull request #32026 from bogdanvlviv/improve-30941Rafael França2018-02-205-25/+56
|\ | | | | Improve ActiveJob custom argument serializers #30941
| * Fix error message about unknown `ActiveJob` argument serializerbogdanvlviv2018-02-172-2/+2
| |
| * Fix docs of ActiveJob custom argument serializersbogdanvlviv2018-02-172-22/+22
| | | | | | | | | | | | Add `:nodoc:` to `ActiveJob::Serializers` Add `:doc:` to `ActiveJob::Serializers::ObjectSerializer#klass` Express `ActiveJob::Serializers::ObjectSerializer#klass` as private method
| * Add argument serializer `TimeWithZoneSerializer`bogdanvlviv2018-02-173-1/+32
| | | | | | | | | | The serializer serializes an instance of `ActiveSupport::TimeWithZone`. The serializer deserializes value to `ActiveSupport::TimeWithZone` if possible.
* | Fix "warning: BigDecimal.new is deprecated"yuuji.yaginuma2018-02-181-1/+1
| |
* | Rails 6 requires Ruby 2.4.1+Jeremy Daer2018-02-174-5/+9
|/ | | | | | Skipping over 2.4.0 to sidestep the `"symbol_from_string".to_sym.dup` bug. References #32028
* Merge pull request #32002 from y-yagi/fix_set_serializerRafael França2018-02-172-4/+9
|\ | | | | Fix custome serializer setting
| * Fix custome serializer settingYuji Yaginuma2018-02-162-4/+9
| | | | | | | | | | | | | | | | The serializer should be set up in `after_initialize` so that it work properly even if the user specifies serializer with initializers. Also, since `custom_serializers` is `Array`, it needs to be flattened before setting the value.
* | Remove support to Ruby 2.2Rafael Mendonça França2018-02-161-1/+1
|/ | | | Rails 6 will only support Ruby >= 2.3.
* Add CHANGELOG entryRafael Mendonça França2018-02-141-0/+3
|
* Add tests to serialize and deserialze individuallyRafael Mendonça França2018-02-141-0/+43
| | | | | This will make easier to be backwards compatible when changing the serialization implementation.
* Simplify the implementation of custom argument serializersRafael Mendonça França2018-02-1412-275/+192
| | | | | | | | | | | | | We can speed up things for the supported types by keeping the code in the way it was. We can also avoid to loop trough all serializers in the deserialization by trying to access the class already in the Hash. We could also speed up the custom serialization if we define the class that is going to be serialized when registering the serializers, but that will remove the possibility of defining a serialzer for a superclass and have the subclass serialized using it.
* Improve documentation on custom serializersRafael Mendonça França2018-02-143-57/+26
|
* Add configuration to set custom serializersRafael Mendonça França2018-02-141-0/+6
|
* No need to require a autoloaded constantRafael Mendonça França2018-02-141-1/+0
|
* Add serializers for Time, Date and DateTimeRafael Mendonça França2018-02-147-2/+77
|
* Allow serializers to be used either as classes or objectsRafael Mendonça França2018-02-1410-124/+110
|
* Add symbol and duration serializersRafael Mendonça França2018-02-144-2/+52
|
* Only add one more custom key in the serialized hashRafael Mendonça França2018-02-146-51/+59
| | | | | | | Now custom serialziers can register itself in the serialized hash using the "_aj_serialized" key that constains the serializer name. This way we can avoid poluting the hash with many reserved keys.
* Define the interface of a SerializerRafael Mendonça França2018-02-141-0/+18
|
* Remove unnecessary qualified constant lookupsRafael Mendonça França2018-02-145-11/+11
|