Base legislation processes and draft versions page structure for public site

This commit is contained in:
Amaia Castro
2016-12-14 15:13:48 +01:00
parent e4315f94c8
commit 766f509f8e
12 changed files with 93 additions and 0 deletions

View File

@@ -11,6 +11,8 @@ module Abilities
can :read, User
can [:search, :read], Annotation
can :new, DirectMessage
can [:read], Legislation::Process
can [:read], Legislation::DraftVersion
end
end
end

View File

@@ -9,4 +9,8 @@ class Legislation::DraftVersion < ActiveRecord::Base
validates :title, presence: true
validates :body, presence: true
validates :status, presence: true, inclusion: { in: VALID_STATUSES }
def body_in_html
body_html || Redcarpet::Markdown.new(Redcarpet::Render::HTML.new).render(body)
end
end