Skip to content

Instantly share code, notes, and snippets.

@ysv
Created April 6, 2020 18:29
Show Gist options
  • Save ysv/42db6bd4f7723795e908ce8ae3494789 to your computer and use it in GitHub Desktop.
Save ysv/42db6bd4f7723795e908ce8ae3494789 to your computer and use it in GitHub Desktop.
# To find unused email templates run next script in the rails console:
`ls app/views/application_mailer`.split(".html.erb\n") - ApplicationMailer.new.local_methods.map(&:to_s).filter {|mn| !mn.include?("_url") }
# To find missing email template for action:
ApplicationMailer.new.local_methods.map(&:to_s).filter {|mn| !mn.include?("_url") } - `ls app/views/application_mailer`.split(".html.erb\n")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment