Sha256: b69a38e71a0f4b64d4d596d61ebfefd151cc498f5980d7f82e5a84b4175e2eb2
Contents?: true
Size: 473 Bytes
Versions: 11
Compression:
Stored size: 473 Bytes
Contents
class HelpTopic < ActiveRecord::Base validates_presence_of :language, :slug, :title, :content validates_format_of :slug, :with => /\A[a-zA-Z0-9_-]+\z/ validates_uniqueness_of :slug, :scope => :language before_save :convert_content_to_html default_scope { where(:language => I18n.locale.to_s) } # open up everything for mass assignment attr_protected protected def convert_content_to_html self.content = RDiscount.new(self.content).to_html end end
Version data entries
11 entries across 11 versions & 1 rubygems