Skip to content

Commit

Permalink
Dont allow empty messages to get created
Browse files Browse the repository at this point in the history
  • Loading branch information
npezza93 committed Jul 16, 2017
1 parent 60d654e commit 381f68d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/models/chat/message.rb
Expand Up @@ -14,6 +14,8 @@ class Chat::Message < ApplicationRecord
before_save :remove_extra_new_line
before_save :execute_dot_command

validates :text, presence: true, unless: :image?

after_create_commit do
Chat::MessageRelayJob.send(Chat.perform_method.to_sym, id)
Chat::NotificationRelayJob.send(Chat.perform_method.to_sym, self)
Expand Down

0 comments on commit 381f68d

Please sign in to comment.