def ensure_valid_role_for_commentable
      allowed_roles = commentable.class.commentable_options[:roles]

      if allowed_roles.any?
        errors.add(:role, :invalid) unless allowed_roles.include?(self.role)
      else
        errors.add(:role, :invalid) unless self.role.blank?
      end
    end
def ensure_valid_role_for_commentable
      allowed_roles = commentable.class.commentable_options[:roles]

      if allowed_roles.any?
        errors.add(:role, :invalid) unless allowed_roles.include?(self.role)
      else
        errors.add(:role, :invalid) unless self.role.blank?
      end
    end
Make sure that the value of the `role` attribute is a valid role
 for the commentable.

 If the commentable doesn't have any comment roles, we make sure
 that the value is blank.