docbrown/app/models/poll_option.rb
Ben Halpern 8ae057b06e
Beta polls feature (admin use only for now) (#3176)
* Initial poll features

* Add basic poll functionality

* Finish (maybe) beta poll functionality
2019-06-15 17:33:30 -04:00

17 lines
367 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