Skip to content

ActiveJobでinitilizeを検知し、before_perform やperform内に移行を促す #68

@kyohah

Description

@kyohah
# Bad
class HogeHogeJob < ApplicationJob
  def initilize
     Slackに通知
     super
  end

  def perform
     ~~~
   end
end

# good

class HogeHogeJob < ApplicationJob
  before_perfrom -> {  Slackに通知 }

  def perform
     ~~~
   end
end


# good

class HogeHogeJob < ApplicationJob
  def perform
     Slackに通知
     ~~~
   end
end

あまり実装する人が少ないCOPでもPR出しても大丈夫でしょうか

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions