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

Version Path
forge-cli-0.1.10 lib/forge/app/models/help_topic.rb
forge-cli-0.1.9 lib/forge/app/models/help_topic.rb
forge-cli-0.1.8 lib/forge/app/models/help_topic.rb
forge-cli-0.1.7 lib/forge/app/models/help_topic.rb
forge-cli-0.1.6 lib/forge/app/models/help_topic.rb
forge-cli-0.1.5 lib/forge/app/models/help_topic.rb
forge-cli-0.1.4 lib/forge/app/models/help_topic.rb
forge-cli-0.1.3 lib/forge/app/models/help_topic.rb
forge-cli-0.1.2 lib/forge/app/models/help_topic.rb
forge-cli-0.1.1 lib/forge/app/models/help_topic.rb
forge-cli-0.1.0 lib/forge/app/models/help_topic.rb