Add comments translations

Co-Authored-By: Sebastia <sebastia.roig@gmail.com>
This commit is contained in:
Senén Rodero Rodríguez
2018-12-24 15:11:16 +01:00
committed by voodoorai2000
parent 096a9f6bb8
commit 158af0217d
4 changed files with 29 additions and 1 deletions

View File

@@ -18,7 +18,10 @@ class Comment < ApplicationRecord
attr_accessor :as_moderator, :as_administrator
validates :body, presence: true
translates :body, touch: true
include Globalizable
validates_translation :body, presence: true
validates :user, presence: true
validates :commentable_type, inclusion: { in: COMMENTABLE_TYPES }