Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
kyohah opened this issue Nov 1, 2024 · 2 comments

Comments

@kyohah
Copy link

kyohah commented Nov 1, 2024

# 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出しても大丈夫でしょうか

@kyohah
Copy link
Author

kyohah commented Nov 1, 2024

作ったもの
kyohah/rubocop-rails@8bee09a

@koic
Copy link
Member

koic commented Jan 4, 2025

ユーザーが bad と good への背景をより掴みやすくするためのテキストを加えて、まず Rails Style Guide の方へのスタイルガイドとして提案をしてみて頂けないでしょうか?
https://github.com/rubocop/rails-style-guide

そちらがとおったら RuboCop Rails の方に PR を開いてください。実装へのフィードバックはその際に行います。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants