Base legislation processes and draft versions page structure for public site
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user