docbrown/app/models/poll_option.rb
Anna Buianova f79b3cb12a Fixed rubocop issues, new .rubocop_todo.yml (#3255)
* Fixed rubocop issues, new .rubocop_todo.yml

* Refined and fixed indentation
2019-06-21 14:26:39 -04:00

17 lines
360 B
Ruby

class PollOption < ApplicationRecord
belongs_to :poll
has_many :poll_votes
validates :markdown, presence: true,
length: { maximum: 128 }
before_save :evaluate_markdown
counter_culture :poll
private
def evaluate_markdown
self.processed_html = MarkdownParser.new(markdown).evaluate_inline_limited_markdown
end
end