Show only published draft versions to users (and also drafts to admins)
This commit is contained in:
@@ -10,6 +10,8 @@ class Legislation::DraftVersion < ActiveRecord::Base
|
||||
validates :body, presence: true
|
||||
validates :status, presence: true, inclusion: { in: VALID_STATUSES }
|
||||
|
||||
scope :published, -> { where(status: 'published').order('id DESC') }
|
||||
|
||||
before_save :render_html
|
||||
|
||||
def render_html
|
||||
|
||||
Reference in New Issue
Block a user