Class: ApplicationJob
- Inherits:
-
ActiveJob::Base
- Object
- ActiveJob::Base
- ApplicationJob
- Defined in:
- /var/apps/qpixel/app/jobs/application_job.rb
Direct Known Subclasses
AutoCloseComplaintsJob, CleanUpNewThreadFollowersJob, CleanUpSpammyUsersJob, CleanUpThreadFollowersJob, CleanupVotesJob, DataDumpJob, DatabaseBackupJob, MailUncapturedDonationsJob, PotentialSpamProfilesJob, RecalcAbilitiesJob, SendSummaryEmailsJob, UpdateUserStatsJob
Instance Method Summary collapse
-
#exec(sql) ⇒ Object
Executes a given SQL statement in the context of the current connection.
-
#initialize(*args, **opts) ⇒ ApplicationJob
constructor
A new instance of ApplicationJob.
- #logger ⇒ Object
Constructor Details
#initialize(*args, **opts) ⇒ ApplicationJob
Returns a new instance of ApplicationJob.
8 9 10 11 |
# File '/var/apps/qpixel/app/jobs/application_job.rb', line 8 def initialize(*args, **opts) @job_id = SecureRandom.uuid super end |
Instance Method Details
#exec(sql) ⇒ Object
Note:
CAUTION: This method does NOT parametrize or escape the SQL statement in any way. YOU are responsible for ensuring sql is safe.
Executes a given SQL statement in the context of the current connection
17 18 19 |
# File '/var/apps/qpixel/app/jobs/application_job.rb', line 17 def exec(sql) ApplicationRecord.connection.execute(sql) end |
#logger ⇒ Object
21 22 23 |
# File '/var/apps/qpixel/app/jobs/application_job.rb', line 21 def logger Rails.job_logger.tagged(self.class.name, @job_id) end |