repo stringlengths 5 92 | file_url stringlengths 80 287 | file_path stringlengths 5 197 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 15:37:27 2026-01-04 17:58:21 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activejob/test/cases/test_helper_test.rb | activejob/test/cases/test_helper_test.rb | # frozen_string_literal: true
require "helper"
require "active_support/core_ext/time"
require "active_support/core_ext/date"
require "active_support/concern"
require "zeitwerk"
require "jobs/hello_job"
require "jobs/logging_job"
require "jobs/nested_job"
require "jobs/rescue_job"
require "jobs/raising_job"
require "jo... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | true |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activejob/test/cases/rescue_test.rb | activejob/test/cases/rescue_test.rb | # frozen_string_literal: true
require "helper"
require "jobs/rescue_job"
require "models/person"
class RescueTest < ActiveSupport::TestCase
setup do
JobBuffer.clear
end
test "rescue perform exception with retry" do
job = RescueJob.new("david")
job.perform_now
assert_equal [ "rescued from Argume... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activejob/test/cases/job_serialization_test.rb | activejob/test/cases/job_serialization_test.rb | # frozen_string_literal: true
require "helper"
require "jobs/gid_job"
require "jobs/hello_job"
require "models/person"
require "json"
require "active_support/json"
class JobSerializationTest < ActiveSupport::TestCase
setup do
JobBuffer.clear
@person = Person.find(5)
end
test "serialize job with gid" do... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activejob/test/cases/queue_priority_test.rb | activejob/test/cases/queue_priority_test.rb | # frozen_string_literal: true
require "helper"
require "jobs/configuration_job"
require "jobs/hello_job"
class QueuePriorityTest < ActiveSupport::TestCase
setup do
JobBuffer.clear
end
test "priority unset by default" do
assert_nil HelloJob.priority
end
test "uses given priority" do
original_pr... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activejob/test/cases/adapter_test.rb | activejob/test/cases/adapter_test.rb | # frozen_string_literal: true
require "helper"
class AdapterTest < ActiveSupport::TestCase
test "should load #{ENV['AJ_ADAPTER']} adapter" do
assert_equal "active_job/queue_adapters/#{ENV['AJ_ADAPTER']}_adapter".classify, ActiveJob::Base.queue_adapter.class.name
end
if adapter_is?(:sidekiq)
test "sidek... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activejob/test/cases/logging_test.rb | activejob/test/cases/logging_test.rb | # frozen_string_literal: true
require "helper"
require "active_support/log_subscriber/test_helper"
require "active_support/core_ext/numeric/time"
require "support/test_logger"
require "jobs/hello_job"
require "jobs/logging_job"
require "jobs/overridden_logging_job"
require "jobs/nested_job"
require "jobs/rescue_job"
r... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activejob/test/cases/queuing_test.rb | activejob/test/cases/queuing_test.rb | # frozen_string_literal: true
require "helper"
require "jobs/hello_job"
require "jobs/enqueue_error_job"
require "jobs/multiple_kwargs_job"
require "active_support/core_ext/numeric/time"
require "minitest/mock"
class QueuingTest < ActiveSupport::TestCase
setup do
JobBuffer.clear
end
test "run queued job" d... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activejob/test/cases/test_case_test.rb | activejob/test/cases/test_case_test.rb | # frozen_string_literal: true
require "helper"
require "jobs/hello_job"
require "jobs/logging_job"
require "jobs/nested_job"
class ActiveJobTestCaseTest < ActiveJob::TestCase
# this tests that this job class doesn't get its adapter set.
# that's the correct behavior since we don't want to break
# the `class_att... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activejob/test/cases/async_adapter_test.rb | activejob/test/cases/async_adapter_test.rb | # frozen_string_literal: true
require "helper"
require "jobs/hello_job"
return unless adapter_is?(:async)
class AsyncAdapterTest < ActiveSupport::TestCase
setup do
JobBuffer.clear
ActiveJob::Base.queue_adapter.immediate = true
end
test "in immediate run, perform_later runs immediately" do
HelloJob... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activejob/test/cases/argument_serialization_test.rb | activejob/test/cases/argument_serialization_test.rb | # frozen_string_literal: true
require "json"
require "bigdecimal"
require "helper"
require "models/person"
require "active_support/core_ext/hash/indifferent_access"
require "active_support/core_ext/integer/time"
require "active_support/duration"
require "jobs/kwargs_job"
require "jobs/arguments_round_trip_job"
require... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activejob/test/cases/timezones_test.rb | activejob/test/cases/timezones_test.rb | # frozen_string_literal: true
require "helper"
require "jobs/timezone_dependent_job"
require "jobs/timezone_raising_job"
class TimezonesTest < ActiveSupport::TestCase
setup do
JobBuffer.clear
end
test "it performs the job in the given timezone" do
job = TimezoneDependentJob.new("2018-01-01T00:00:00Z")
... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activejob/test/cases/queue_adapter_test.rb | activejob/test/cases/queue_adapter_test.rb | # frozen_string_literal: true
require "helper"
module ActiveJob
module QueueAdapters
class StubOneAdapter
def enqueue(*); end
def enqueue_at(*); end
end
class StubTwoAdapter
def enqueue(*); end
def enqueue_at(*); end
end
end
end
class QueueAdapterTest < ActiveJob::TestCas... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activejob/test/cases/queue_naming_test.rb | activejob/test/cases/queue_naming_test.rb | # frozen_string_literal: true
require "helper"
require "jobs/configuration_job"
require "jobs/hello_job"
require "jobs/prefixed_job"
require "jobs/logging_job"
require "jobs/nested_job"
class QueueNamingTest < ActiveSupport::TestCase
setup do
JobBuffer.clear
end
test "name derived from base" do
assert_... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activejob/test/cases/translation_test.rb | activejob/test/cases/translation_test.rb | # frozen_string_literal: true
require "helper"
require "jobs/translated_hello_job"
require "jobs/translated_raising_job"
class TranslationTest < ActiveSupport::TestCase
setup do
JobBuffer.clear
I18n.available_locales = [:en, :de]
end
teardown do
I18n.available_locales = [:en]
end
test "it perf... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activejob/test/cases/exceptions_test.rb | activejob/test/cases/exceptions_test.rb | # frozen_string_literal: true
require "helper"
require "jobs/retry_job"
require "jobs/retries_job"
require "jobs/after_discard_retry_job"
require "models/person"
require "minitest/mock"
class ExceptionsTest < ActiveSupport::TestCase
class << self
def adapter_skips_scheduling?(queue_adapter)
[
Acti... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activejob/test/cases/delayed_job_adapter_test.rb | activejob/test/cases/delayed_job_adapter_test.rb | # frozen_string_literal: true
require "helper"
require "jobs/disable_log_job"
require "jobs/hello_job"
return unless adapter_is?(:delayed_job)
class DelayedJobAdapterTest < ActiveSupport::TestCase
test "does not log arguments when log_arguments is set to false on a job" do
job_id = SecureRandom.uuid
job_w... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activejob/test/cases/callbacks_test.rb | activejob/test/cases/callbacks_test.rb | # frozen_string_literal: true
require "helper"
require "jobs/callback_job"
require "jobs/abort_before_enqueue_job"
require "active_support/core_ext/object/inclusion"
class CallbacksTest < ActiveSupport::TestCase
test "perform callbacks" do
performed_callback_job = CallbackJob.new("A-JOB-ID")
performed_call... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activejob/test/cases/continuation_test.rb | activejob/test/cases/continuation_test.rb | # frozen_string_literal: true
require "helper"
require "active_job/continuation/test_helper"
require "active_support/testing/stream"
require "active_support/core_ext/object/with"
require "support/test_logger"
require "support/do_not_perform_enqueued_jobs"
return unless adapter_is?(:test)
class ActiveJob::TestContinu... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activejob/test/models/person.rb | activejob/test/models/person.rb | # frozen_string_literal: true
class Person
class RecordNotFound < StandardError; end
include GlobalID::Identification
attr_reader :id
def self.find(id)
raise RecordNotFound.new("Cannot find person with ID=404") if id.to_i == 404
new(id)
end
def initialize(id)
@id = id
end
def ==(other_... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activejob/test/adapters/test.rb | activejob/test/adapters/test.rb | # frozen_string_literal: true
ActiveJob::Base.queue_adapter = :test
ActiveJob::Base.queue_adapter.perform_enqueued_jobs = true
ActiveJob::Base.queue_adapter.perform_enqueued_at_jobs = true
| ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activejob/test/adapters/queue_classic.rb | activejob/test/adapters/queue_classic.rb | # frozen_string_literal: true
require "support/queue_classic/inline"
ActiveJob::Base.queue_adapter = :queue_classic
| ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activejob/test/adapters/inline.rb | activejob/test/adapters/inline.rb | # frozen_string_literal: true
ActiveJob::Base.queue_adapter = :inline
| ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activejob/test/adapters/sidekiq.rb | activejob/test/adapters/sidekiq.rb | # frozen_string_literal: true
require "sidekiq/testing/inline"
ActiveJob::Base.queue_adapter = :sidekiq
| ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activejob/test/adapters/resque.rb | activejob/test/adapters/resque.rb | # frozen_string_literal: true
ActiveJob::Base.queue_adapter = :resque
Resque.inline = true
| ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activejob/test/adapters/backburner.rb | activejob/test/adapters/backburner.rb | # frozen_string_literal: true
require "support/backburner/inline"
ActiveJob::Base.queue_adapter = :backburner
| ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activejob/test/adapters/delayed_job.rb | activejob/test/adapters/delayed_job.rb | # frozen_string_literal: true
ActiveJob::Base.queue_adapter = :delayed_job
$LOAD_PATH << File.expand_path("../support/delayed_job", __dir__)
require "active_support/core_ext/kernel/reporting"
Delayed::Worker.delay_jobs = false
Delayed::Worker.backend = :test
| ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activejob/test/adapters/sneakers.rb | activejob/test/adapters/sneakers.rb | # frozen_string_literal: true
require "support/sneakers/inline"
ActiveJob::Base.queue_adapter = :sneakers
| ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activejob/test/adapters/async.rb | activejob/test/adapters/async.rb | # frozen_string_literal: true
ActiveJob::Base.queue_adapter = :async
ActiveJob::Base.queue_adapter.immediate = true
| ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activejob/lib/active_job.rb | activejob/lib/active_job.rb | # frozen_string_literal: true
#--
# Copyright (c) David Heinemeier Hansson
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activejob/lib/rails/generators/job/job_generator.rb | activejob/lib/rails/generators/job/job_generator.rb | # frozen_string_literal: true
require "rails/generators/named_base"
module Rails # :nodoc:
module Generators # :nodoc:
class JobGenerator < Rails::Generators::NamedBase # :nodoc:
class_option :queue, type: :string, default: "default", desc: "The queue name for the generated job"
class_option :paren... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activejob/lib/active_job/core.rb | activejob/lib/active_job/core.rb | # frozen_string_literal: true
module ActiveJob
# Raised during job payload deserialization when it references an uninitialized job class.
class UnknownJobClassError < NameError
def initialize(job_class_name)
super("Failed to instantiate job, class `#{job_class_name}` doesn't exist", job_class_name)
e... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activejob/lib/active_job/test_case.rb | activejob/lib/active_job/test_case.rb | # frozen_string_literal: true
require "active_support/test_case"
module ActiveJob
class TestCase < ActiveSupport::TestCase
include ActiveJob::TestHelper
ActiveSupport.run_load_hooks(:active_job_test_case, self)
end
end
| ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activejob/lib/active_job/version.rb | activejob/lib/active_job/version.rb | # frozen_string_literal: true
require_relative "gem_version"
module ActiveJob
# Returns the currently loaded version of Active Job as a +Gem::Version+.
def self.version
gem_version
end
end
| ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activejob/lib/active_job/exceptions.rb | activejob/lib/active_job/exceptions.rb | # frozen_string_literal: true
require "active_support/core_ext/numeric/time"
module ActiveJob
# Provides behavior for retrying and discarding jobs on exceptions.
module Exceptions
extend ActiveSupport::Concern
included do
class_attribute :retry_jitter, instance_accessor: false, instance_predicate: ... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activejob/lib/active_job/log_subscriber.rb | activejob/lib/active_job/log_subscriber.rb | # frozen_string_literal: true
require "active_support/log_subscriber"
module ActiveJob
class LogSubscriber < ActiveSupport::EventReporter::LogSubscriber # :nodoc:
class_attribute :backtrace_cleaner, default: ActiveSupport::BacktraceCleaner.new
self.namespace = "active_job"
def enqueued(event)
pa... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activejob/lib/active_job/enqueuing.rb | activejob/lib/active_job/enqueuing.rb | # frozen_string_literal: true
module ActiveJob
# Provides behavior for enqueuing jobs.
# Can be raised by adapters if they wish to communicate to the caller a reason
# why the adapter was unexpectedly unable to enqueue a job.
class EnqueueError < StandardError; end
class << self
# Push many jobs onto t... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activejob/lib/active_job/queue_adapter.rb | activejob/lib/active_job/queue_adapter.rb | # frozen_string_literal: true
require "active_support/core_ext/string/inflections"
module ActiveJob
class << self
def adapter_name(adapter) # :nodoc:
return adapter.queue_adapter_name if adapter.respond_to?(:queue_adapter_name)
adapter_class = adapter.is_a?(Module) ? adapter : adapter.class
"... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activejob/lib/active_job/logging.rb | activejob/lib/active_job/logging.rb | # frozen_string_literal: true
require "active_support/tagged_logging"
require "active_support/logger"
module ActiveJob
module Logging
extend ActiveSupport::Concern
included do
##
# Accepts a logger conforming to the interface of Log4r or the default
# Ruby +Logger+ class. You can retrieve... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activejob/lib/active_job/arguments.rb | activejob/lib/active_job/arguments.rb | # frozen_string_literal: true
require "bigdecimal"
require "active_support/core_ext/hash"
module ActiveJob
# Raised when an exception is raised during job arguments deserialization.
#
# Wraps the original exception raised as +cause+.
class DeserializationError < StandardError
def initialize # :nodoc:
... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activejob/lib/active_job/configured_job.rb | activejob/lib/active_job/configured_job.rb | # frozen_string_literal: true
module ActiveJob
class ConfiguredJob # :nodoc:
def initialize(job_class, options = {})
@options = options
@job_class = job_class
end
def perform_now(...)
@job_class.new(...).set(@options).perform_now
end
def perform_later(...)
job = @job_cla... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activejob/lib/active_job/callbacks.rb | activejob/lib/active_job/callbacks.rb | # frozen_string_literal: true
require "active_support/callbacks"
require "active_support/core_ext/module/attribute_accessors"
module ActiveJob
# = Active Job \Callbacks
#
# Active Job provides hooks during the life cycle of a job. Callbacks allow you
# to trigger logic during this cycle. Available callbacks a... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activejob/lib/active_job/continuation.rb | activejob/lib/active_job/continuation.rb | # frozen_string_literal: true
require "active_support/core_ext/numeric/time"
require "active_job/continuable"
module ActiveJob
# = Active Job \Continuation
#
# Continuations provide a mechanism for interrupting and resuming jobs. This allows
# long-running jobs to make progress across application restarts.
... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activejob/lib/active_job/queue_name.rb | activejob/lib/active_job/queue_name.rb | # frozen_string_literal: true
module ActiveJob
module QueueName
extend ActiveSupport::Concern
# Includes the ability to override the default queue name and prefix.
module ClassMethods
mattr_accessor :default_queue_name, default: "default"
# Specifies the name of the queue to process the job... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activejob/lib/active_job/structured_event_subscriber.rb | activejob/lib/active_job/structured_event_subscriber.rb | # frozen_string_literal: true
require "active_support/structured_event_subscriber"
module ActiveJob
class StructuredEventSubscriber < ActiveSupport::StructuredEventSubscriber # :nodoc:
def enqueue(event)
job = event.payload[:job]
adapter = event.payload[:adapter]
exception = event.payload[:exc... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activejob/lib/active_job/execution_state.rb | activejob/lib/active_job/execution_state.rb | # frozen_string_literal: true
module ActiveJob
module ExecutionState # :nodoc:
def perform_now
I18n.with_locale(locale) do
Time.use_zone(timezone) { super }
end
end
end
end
| ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activejob/lib/active_job/railtie.rb | activejob/lib/active_job/railtie.rb | # frozen_string_literal: true
require "rails"
require "global_id/railtie"
require "active_job"
module ActiveJob
# = Active Job Railtie
class Railtie < Rails::Railtie # :nodoc:
config.active_job = ActiveSupport::OrderedOptions.new
config.active_job.custom_serializers = []
config.active_job.log_query_ta... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activejob/lib/active_job/enqueue_after_transaction_commit.rb | activejob/lib/active_job/enqueue_after_transaction_commit.rb | # frozen_string_literal: true
module ActiveJob
module EnqueueAfterTransactionCommit # :nodoc:
class << self
def included(base)
ActiveJob.singleton_class.prepend(ActiveJobMethods)
end
end
module ActiveJobMethods
# Ensures perform_all_later respects each job's enqueue_after_trans... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activejob/lib/active_job/base.rb | activejob/lib/active_job/base.rb | # frozen_string_literal: true
require "active_job/core"
require "active_job/queue_adapter"
require "active_job/queue_name"
require "active_job/queue_priority"
require "active_job/enqueuing"
require "active_job/execution"
require "active_job/callbacks"
require "active_job/exceptions"
require "active_job/log_subscriber"... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activejob/lib/active_job/test_helper.rb | activejob/lib/active_job/test_helper.rb | # frozen_string_literal: true
require "active_support/core_ext/class/subclasses"
require "active_support/testing/assertions"
module ActiveJob
# Provides helper methods for testing Active Job
module TestHelper
delegate :enqueued_jobs, :enqueued_jobs=,
:performed_jobs, :performed_jobs=,
to: :queue_a... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activejob/lib/active_job/queue_adapters.rb | activejob/lib/active_job/queue_adapters.rb | # frozen_string_literal: true
module ActiveJob
# = Active Job adapters
#
# Active Job has adapters for the following queuing backends:
#
# * {Backburner}[https://github.com/nesquena/backburner]
# * {Delayed Job}[https://github.com/collectiveidea/delayed_job]
# * {Que}[https://github.com/chanks/que]
# *... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activejob/lib/active_job/queue_priority.rb | activejob/lib/active_job/queue_priority.rb | # frozen_string_literal: true
module ActiveJob
module QueuePriority
extend ActiveSupport::Concern
# Includes the ability to override the default queue priority.
module ClassMethods
mattr_accessor :default_priority
# Specifies the priority of the queue to create the job with.
#
#... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activejob/lib/active_job/continuable.rb | activejob/lib/active_job/continuable.rb | # frozen_string_literal: true
module ActiveJob
# = Active Job Continuable
#
# The Continuable module provides the ability to track the progress of your
# jobs, and continue from where they left off if interrupted.
#
# Mix ActiveJob::Continuable into your job to enable continuations.
#
# See {ActiveJob:... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activejob/lib/active_job/execution.rb | activejob/lib/active_job/execution.rb | # frozen_string_literal: true
require "active_support/rescuable"
module ActiveJob
# = Active Job \Execution
#
# Provides methods to execute jobs immediately, and wraps job execution so
# that exceptions configured with
# {rescue_from}[rdoc-ref:ActiveSupport::Rescuable::ClassMethods#rescue_from]
# are hand... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activejob/lib/active_job/deprecator.rb | activejob/lib/active_job/deprecator.rb | # frozen_string_literal: true
module ActiveJob
def self.deprecator # :nodoc:
@deprecator ||= ActiveSupport::Deprecation.new
end
end
| ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activejob/lib/active_job/gem_version.rb | activejob/lib/active_job/gem_version.rb | # frozen_string_literal: true
module ActiveJob
# Returns the currently loaded version of Active Job as a +Gem::Version+.
def self.gem_version
Gem::Version.new VERSION::STRING
end
module VERSION
MAJOR = 8
MINOR = 2
TINY = 0
PRE = "alpha"
STRING = [MAJOR, MINOR, TINY, PRE].compact.jo... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activejob/lib/active_job/instrumentation.rb | activejob/lib/active_job/instrumentation.rb | # frozen_string_literal: true
module ActiveJob
class << self
private
def instrument_enqueue_all(queue_adapter, jobs)
payload = { adapter: queue_adapter, jobs: jobs }
ActiveSupport::Notifications.instrument("enqueue_all.active_job", payload) do
result = yield payload
payl... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activejob/lib/active_job/serializers.rb | activejob/lib/active_job/serializers.rb | # frozen_string_literal: true
module ActiveJob
# = Active Job \Serializers
#
# The +ActiveJob::Serializers+ module is used to store a list of known serializers
# and to add new ones. It also has helpers to serialize/deserialize objects.
module Serializers # :nodoc:
extend ActiveSupport::Autoload
aut... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activejob/lib/active_job/serializers/duration_serializer.rb | activejob/lib/active_job/serializers/duration_serializer.rb | # frozen_string_literal: true
module ActiveJob
module Serializers
class DurationSerializer < ObjectSerializer # :nodoc:
def serialize(duration)
# Ideally duration.parts would be wrapped in an array before passing to Arguments.serialize,
# but we continue passing the bare hash for backwards ... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activejob/lib/active_job/serializers/module_serializer.rb | activejob/lib/active_job/serializers/module_serializer.rb | # frozen_string_literal: true
module ActiveJob
module Serializers
class ModuleSerializer < ObjectSerializer # :nodoc:
def serialize(constant)
raise SerializationError, "Serializing an anonymous class is not supported" unless constant.name
super("value" => constant.name)
end
def... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activejob/lib/active_job/serializers/time_serializer.rb | activejob/lib/active_job/serializers/time_serializer.rb | # frozen_string_literal: true
module ActiveJob
module Serializers
class TimeSerializer < TimeObjectSerializer # :nodoc:
def deserialize(hash)
Time.iso8601(hash["value"])
end
def klass
Time
end
end
end
end
| ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activejob/lib/active_job/serializers/action_controller_parameters_serializer.rb | activejob/lib/active_job/serializers/action_controller_parameters_serializer.rb | # frozen_string_literal: true
module ActiveJob
module Serializers
class ActionControllerParametersSerializer < ObjectSerializer
def serialize(argument)
Arguments.serialize_argument(argument.to_h.with_indifferent_access)
end
def deserialize(hash)
raise NotImplementedError # Seri... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activejob/lib/active_job/serializers/date_serializer.rb | activejob/lib/active_job/serializers/date_serializer.rb | # frozen_string_literal: true
module ActiveJob
module Serializers
class DateSerializer < ObjectSerializer # :nodoc:
def serialize(date)
super("value" => date.iso8601)
end
def deserialize(hash)
Date.iso8601(hash["value"])
end
def klass
Date
end
end... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activejob/lib/active_job/serializers/date_time_serializer.rb | activejob/lib/active_job/serializers/date_time_serializer.rb | # frozen_string_literal: true
module ActiveJob
module Serializers
class DateTimeSerializer < TimeObjectSerializer # :nodoc:
def deserialize(hash)
DateTime.iso8601(hash["value"])
end
def klass
DateTime
end
end
end
end
| ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activejob/lib/active_job/serializers/big_decimal_serializer.rb | activejob/lib/active_job/serializers/big_decimal_serializer.rb | # frozen_string_literal: true
require "bigdecimal"
module ActiveJob
module Serializers
class BigDecimalSerializer < ObjectSerializer # :nodoc:
def serialize(big_decimal)
super("value" => big_decimal.to_s)
end
def deserialize(hash)
BigDecimal(hash["value"])
end
def... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activejob/lib/active_job/serializers/symbol_serializer.rb | activejob/lib/active_job/serializers/symbol_serializer.rb | # frozen_string_literal: true
module ActiveJob
module Serializers
class SymbolSerializer < ObjectSerializer # :nodoc:
def serialize(argument)
super("value" => argument.name)
end
def deserialize(argument)
argument["value"].to_sym
end
def klass
Symbol
e... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activejob/lib/active_job/serializers/object_serializer.rb | activejob/lib/active_job/serializers/object_serializer.rb | # frozen_string_literal: true
require "singleton"
module ActiveJob
module Serializers
# Base class for serializing and deserializing custom objects.
#
# Example:
#
# class MoneySerializer < ActiveJob::Serializers::ObjectSerializer
# def serialize(money)
# super("amount" => mo... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activejob/lib/active_job/serializers/time_with_zone_serializer.rb | activejob/lib/active_job/serializers/time_with_zone_serializer.rb | # frozen_string_literal: true
module ActiveJob
module Serializers
class TimeWithZoneSerializer < ObjectSerializer # :nodoc:
NANO_PRECISION = 9
def serialize(time_with_zone)
super(
"value" => time_with_zone.iso8601(NANO_PRECISION),
"time_zone" => time_with_zone.time_zone.t... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activejob/lib/active_job/serializers/time_object_serializer.rb | activejob/lib/active_job/serializers/time_object_serializer.rb | # frozen_string_literal: true
module ActiveJob
module Serializers
class TimeObjectSerializer < ObjectSerializer # :nodoc:
NANO_PRECISION = 9
def serialize(time)
super("value" => time.iso8601(NANO_PRECISION))
end
end
end
end
| ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activejob/lib/active_job/serializers/range_serializer.rb | activejob/lib/active_job/serializers/range_serializer.rb | # frozen_string_literal: true
module ActiveJob
module Serializers
class RangeSerializer < ObjectSerializer
def serialize(range)
super(
"begin" => Arguments.serialize_argument(range.begin),
"end" => Arguments.serialize_argument(range.end),
"exclude_end" => range.exclude... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activejob/lib/active_job/continuation/step.rb | activejob/lib/active_job/continuation/step.rb | # frozen_string_literal: true
module ActiveJob
class Continuation
# = Active Job Continuation Step
#
# Represents a step within a continuable job.
#
# When a step is completed, it is recorded in the job's continuation state.
# If the job is interrupted, it will be resumed from after the last ... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activejob/lib/active_job/continuation/test_helper.rb | activejob/lib/active_job/continuation/test_helper.rb | # frozen_string_literal: true
require "active_job/test_helper"
require "active_job/continuation"
module ActiveJob
class Continuation
# Test helper for ActiveJob::Continuable jobs.
#
module TestHelper
include ::ActiveJob::TestHelper
# Interrupt a job during a step.
#
# class MyJ... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activejob/lib/active_job/continuation/validation.rb | activejob/lib/active_job/continuation/validation.rb | # frozen_string_literal: true
module ActiveJob
class Continuation
module Validation # :nodoc:
private
def validate_step!(name)
validate_step_symbol!(name)
validate_step_not_encountered!(name)
validate_step_not_nested!(name)
validate_step_resume_expected!(name... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activejob/lib/active_job/queue_adapters/sneakers_adapter.rb | activejob/lib/active_job/queue_adapters/sneakers_adapter.rb | # frozen_string_literal: true
require "sneakers"
require "monitor"
module ActiveJob
module QueueAdapters
# = Sneakers adapter for Active Job
#
# A high-performance RabbitMQ background processing framework for Ruby.
# Sneakers is being used in production for both I/O and CPU intensive
# workloads... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activejob/lib/active_job/queue_adapters/async_adapter.rb | activejob/lib/active_job/queue_adapters/async_adapter.rb | # frozen_string_literal: true
require "securerandom"
require "concurrent/scheduled_task"
require "concurrent/executor/thread_pool_executor"
require "concurrent/utility/processor_counter"
module ActiveJob
module QueueAdapters
# = Active Job Async adapter
#
# The Async adapter runs jobs with an in-process... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activejob/lib/active_job/queue_adapters/inline_adapter.rb | activejob/lib/active_job/queue_adapters/inline_adapter.rb | # frozen_string_literal: true
module ActiveJob
module QueueAdapters
# = Active Job Inline adapter
#
# When enqueuing jobs with the Inline adapter the job will be executed
# immediately.
#
# To use the Inline set the queue_adapter config to +:inline+.
#
# Rails.application.config.act... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activejob/lib/active_job/queue_adapters/queue_classic_adapter.rb | activejob/lib/active_job/queue_adapters/queue_classic_adapter.rb | # frozen_string_literal: true
require "queue_classic"
module ActiveJob
module QueueAdapters
# = queue_classic adapter for Active Job
#
# queue_classic provides a simple interface to a PostgreSQL-backed message
# queue. queue_classic specializes in concurrent locking and minimizing
# database loa... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activejob/lib/active_job/queue_adapters/resque_adapter.rb | activejob/lib/active_job/queue_adapters/resque_adapter.rb | # frozen_string_literal: true
require "resque"
require "active_support/core_ext/enumerable"
require "active_support/core_ext/array/access"
begin
require "resque-scheduler"
rescue LoadError
begin
require "resque_scheduler"
rescue LoadError
false
end
end
module ActiveJob
module QueueAdapters
# = ... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activejob/lib/active_job/queue_adapters/sidekiq_adapter.rb | activejob/lib/active_job/queue_adapters/sidekiq_adapter.rb | # frozen_string_literal: true
gem "sidekiq", ">= 4.1.0"
require "sidekiq"
module ActiveJob
module QueueAdapters
# = Sidekiq adapter for Active Job
#
# Simple, efficient background processing for Ruby. Sidekiq uses threads to
# handle many jobs at the same time in the same process. It does not
# ... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activejob/lib/active_job/queue_adapters/delayed_job_adapter.rb | activejob/lib/active_job/queue_adapters/delayed_job_adapter.rb | # frozen_string_literal: true
require "delayed_job"
require "active_support/core_ext/string/inflections"
module ActiveJob
module QueueAdapters
# = Delayed Job adapter for Active Job
#
# Delayed::Job (or DJ) encapsulates the common pattern of asynchronously
# executing longer tasks in the background.... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activejob/lib/active_job/queue_adapters/abstract_adapter.rb | activejob/lib/active_job/queue_adapters/abstract_adapter.rb | # frozen_string_literal: true
module ActiveJob
module QueueAdapters
# = Active Job Abstract Adapter
#
# Active Job supports multiple job queue systems. ActiveJob::QueueAdapters::AbstractAdapter
# forms the abstraction layer which makes this possible.
class AbstractAdapter
attr_accessor :sto... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activejob/lib/active_job/queue_adapters/test_adapter.rb | activejob/lib/active_job/queue_adapters/test_adapter.rb | # frozen_string_literal: true
module ActiveJob
module QueueAdapters
# = Test adapter for Active Job
#
# The test adapter should be used only in testing. Along with
# ActiveJob::TestCase and ActiveJob::TestHelper
# it makes a great tool to test your \Rails application.
#
# To use the test ... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activejob/lib/active_job/queue_adapters/backburner_adapter.rb | activejob/lib/active_job/queue_adapters/backburner_adapter.rb | # frozen_string_literal: true
require "backburner"
module ActiveJob
module QueueAdapters
# = Backburner adapter for Active Job
#
# Backburner is a beanstalkd-powered job queue that can handle a very
# high volume of jobs. You create background jobs and place them on
# multiple work queues to be ... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionview/test/buffers_test.rb | actionview/test/buffers_test.rb | # frozen_string_literal: true
require "abstract_unit"
module SharedBufferTests
def self.included(test_case)
test_case.test "#<< maintains HTML safety" do
@buffer << "<script>alert('pwned!')</script>"
assert_predicate @buffer, :html_safe?
assert_predicate output, :html_safe?
assert_equal ... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionview/test/active_record_unit.rb | actionview/test/active_record_unit.rb | # frozen_string_literal: true
require "abstract_unit"
# Define the essentials
class ActiveRecordTestConnector
cattr_accessor :able_to_connect
cattr_accessor :connected
# Set our defaults
self.connected = false
self.able_to_connect = true
end
# Try to grab AR
unless defined?(ActiveRecord) && defined?(Fixtu... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionview/test/abstract_unit.rb | actionview/test/abstract_unit.rb | # frozen_string_literal: true
require_relative "../../tools/strict_warnings"
$:.unshift File.expand_path("lib", __dir__)
ENV["TMPDIR"] = File.expand_path("tmp", __dir__)
require "active_support/core_ext/kernel/reporting"
# These are the normal settings that will be set up by Railties
# TODO: Have these tests suppo... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionview/test/activerecord/render_partial_with_record_identification_test.rb | actionview/test/activerecord/render_partial_with_record_identification_test.rb | # frozen_string_literal: true
require "active_record_unit"
class RenderPartialWithRecordIdentificationController < ActionController::Base
ROUTES = test_routes do
get :render_with_record_collection, to: "render_partial_with_record_identification#render_with_record_collection"
get :render_with_scope, to: "ren... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionview/test/activerecord/multifetch_cache_test.rb | actionview/test/activerecord/multifetch_cache_test.rb | # frozen_string_literal: true
require "active_record_unit"
class MultifetchController < ActionController::Base
ROUTES = test_routes do
get :cached_true, to: "multifetch#cached_true"
get :cached_proc, to: "multifetch#cached_proc"
end
def cached_true
load_all_topics
render partial: "test/multifet... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionview/test/activerecord/partial_rendering_query_test.rb | actionview/test/activerecord/partial_rendering_query_test.rb | # frozen_string_literal: true
require "active_record_unit"
class PartialRenderingQueryTest < ActiveRecordTestCase
def setup
@view = ActionView::Base
.with_empty_template_cache
.with_view_paths(ActionController::Base.view_paths, {})
end
def test_render_with_relation_collection
assert_notific... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionview/test/activerecord/controller_runtime_test.rb | actionview/test/activerecord/controller_runtime_test.rb | # frozen_string_literal: true
require "active_record_unit"
require "active_record/railties/controller_runtime"
require "fixtures/project"
require "active_support/log_subscriber/test_helper"
require "action_controller/structured_event_subscriber"
require "action_controller/log_subscriber"
ActionController::Base.includ... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionview/test/activerecord/relation_cache_test.rb | actionview/test/activerecord/relation_cache_test.rb | # frozen_string_literal: true
require "active_record_unit"
require "active_record/testing/query_assertions"
class RelationCacheTest < ActionView::TestCase
tests ActionView::Helpers::CacheHelper
include ActiveRecord::Assertions::QueryAssertions
def setup
super
view_paths = ActionController::Base.vie... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionview/test/activerecord/form_helper_activerecord_test.rb | actionview/test/activerecord/form_helper_activerecord_test.rb | # frozen_string_literal: true
require "active_record_unit"
require "fixtures/project"
require "fixtures/developer"
class FormHelperActiveRecordTest < ActionView::TestCase
tests ActionView::Helpers::FormHelper
def form_for(*)
@rendered = super
end
def setup
@developer = Developer.new
@developer.i... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionview/test/activerecord/polymorphic_routes_test.rb | actionview/test/activerecord/polymorphic_routes_test.rb | # frozen_string_literal: true
require "active_record_unit"
require "fixtures/project"
class Task < ActiveRecord::Base
self.table_name = "projects"
end
class Step < ActiveRecord::Base
self.table_name = "projects"
end
class Bid < ActiveRecord::Base
self.table_name = "projects"
end
class Tax < ActiveRecord::Bas... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionview/test/activerecord/debug_helper_test.rb | actionview/test/activerecord/debug_helper_test.rb | # frozen_string_literal: true
require "active_record_unit"
require "nokogiri"
class DebugHelperTest < ActionView::TestCase
def test_debug
company = Company.new(name: "firebase")
output = debug(company)
assert_match "name: name", output
assert_match "value_before_type_cast: firebase", output
asse... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionview/test/fixtures/project.rb | actionview/test/fixtures/project.rb | # frozen_string_literal: true
class Project < ActiveRecord::Base
has_and_belongs_to_many :developers, -> { uniq }
def self.collection_cache_key(collection = all, timestamp_column = :updated_at)
"projects-#{collection.count}"
end
end
| ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionview/test/fixtures/topic.rb | actionview/test/fixtures/topic.rb | # frozen_string_literal: true
class Topic < ActiveRecord::Base
has_many :replies, dependent: :destroy
end
| ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionview/test/fixtures/mascot.rb | actionview/test/fixtures/mascot.rb | # frozen_string_literal: true
class Mascot < ActiveRecord::Base
belongs_to :company
end
| ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionview/test/fixtures/reply.rb | actionview/test/fixtures/reply.rb | # frozen_string_literal: true
class Reply < ActiveRecord::Base
scope :base, -> { all }
belongs_to :topic, -> { includes(:replies) }
belongs_to :developer
validates_presence_of :content
end
| ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionview/test/fixtures/developer.rb | actionview/test/fixtures/developer.rb | # frozen_string_literal: true
class Developer < ActiveRecord::Base
has_and_belongs_to_many :projects
has_many :replies
has_many :topics, through: :replies
accepts_nested_attributes_for :projects
end
| ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionview/test/fixtures/company.rb | actionview/test/fixtures/company.rb | # frozen_string_literal: true
class Company < ActiveRecord::Base
has_one :mascot
self.sequence_name = :companies_nonstd_seq
validates_presence_of :name
def validate
errors.add("rating", "rating should not be 2") if rating == 2
end
end
| ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionview/test/fixtures/helpers/helpery_test_helper.rb | actionview/test/fixtures/helpers/helpery_test_helper.rb | # frozen_string_literal: true
module HelperyTestHelper
def helpery_test
"Default"
end
end
| ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.