Skip to content

Commit

Permalink
Skip application notifier if it already exists
Browse files Browse the repository at this point in the history
  • Loading branch information
excid3 committed May 24, 2024
1 parent 5a1fb91 commit bc93b64
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/generators/noticed/notifier_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,12 @@ class NotifierGenerator < Rails::Generators::NamedBase

desc "Generates a notification with the given NAME."

def generate_notification
def generate_abstract_class
return if File.exist?("app/notifiers/application_notifier.rb")
template "application_notifier.rb", "app/notifiers/application_notifier.rb"
end

def generate_notification
template "notifier.rb", "app/notifiers/#{file_path}_notifier.rb"
end

Expand Down

0 comments on commit bc93b64

Please sign in to comment.