Skip to content

Commit

Permalink
rubocop fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ArushC committed Feb 21, 2024
1 parent 1b42b58 commit 96267f9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app/controllers/email_templates_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def update
flash[:success] = "Updated #{template.title} template successfully."
redirect_to email_templates_path
else
flash[:alert] = "Failed to save #{template.title} template: " + template.errors.full_messages.join(', ')
flash[:alert] = "Failed to save #{template.title} template: " + template.errors.full_messages.join(", ")
redirect_to edit_email_template_path(params[:id])
end
end
Expand All @@ -36,7 +36,7 @@ def create
flash[:success] = "Created #{@email_template.title} successfully."
redirect_to email_templates_path
else
flash[:alert] = "Failed to submit information: " + @email_template.errors.full_messages.join(', ')
flash[:alert] = "Failed to submit information: " + @email_template.errors.full_messages.join(", ")
render "new"
end
end
Expand Down
4 changes: 2 additions & 2 deletions app/models/email_template.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ class EmailTemplate < ApplicationRecord
validates :title,
inclusion: TeacherMailer.instance_methods(false).map { |method| method.to_s.titlecase },
if: -> { self.required? }
validates :body, presence: {message: "cannot be blank" }
validates :to, presence: {message: "cannot be blank" }
validates :body, presence: { message: "cannot be blank" }
validates :to, presence: { message: "cannot be blank" }

before_destroy :prevent_deleting_required_emails

Expand Down

0 comments on commit 96267f9

Please sign in to comment.