Sha256: c80ab5e6610fc24578a843c35f708787e6b28abed55009a995d1739ed3c65bf8
Contents?: true
Size: 394 Bytes
Versions: 3
Compression:
Stored size: 394 Bytes
Contents
class ContentBlock < ActiveRecord::Base extend FriendlyId friendly_id :title, use: :slugged validates :title, :slug, uniqueness: true validates :title, presence: true validates :slug, presence: true, on: :update belongs_to :page default_scope includes(:page).order('pages.title') def render if allow_html content.html_safe else content end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
manifest-rails-0.1.2 | app/models/content_block.rb |
manifest-rails-0.1.1 | app/models/content_block.rb |
manifest-rails-0.1.0 | app/models/content_block.rb |