scinote-web/app/models/result_text.rb

12 lines
319 B
Ruby
Raw Normal View History

# frozen_string_literal: true
2017-06-23 21:19:08 +08:00
class ResultText < ApplicationRecord
2019-03-11 20:43:50 +08:00
include TinyMceImages
2019-03-20 21:40:18 +08:00
auto_strip_attributes :text, nullify: false
validates :result, :text, presence: true
validates :text, length: { maximum: Constants::RICH_TEXT_MAX_LENGTH }
belongs_to :result, inverse_of: :result_text, touch: true
2016-02-12 23:52:43 +08:00
end