Fix draft versions list
This commit is contained in:
@@ -3,7 +3,7 @@ class Legislation::Process < ActiveRecord::Base
|
||||
include ActsAsParanoidAliases
|
||||
|
||||
has_many :draft_versions, -> { order(:id) }, class_name: 'Legislation::DraftVersion', foreign_key: 'legislation_process_id'
|
||||
has_one :final_draft_version, -> { where final_version: true }, class_name: 'Legislation::DraftVersion', foreign_key: 'legislation_process_id'
|
||||
has_one :final_draft_version, -> { where final_version: true, status: 'published' }, class_name: 'Legislation::DraftVersion', foreign_key: 'legislation_process_id'
|
||||
has_many :questions, -> { order(:id) }, class_name: 'Legislation::Question', foreign_key: 'legislation_process_id'
|
||||
|
||||
validates :title, presence: true
|
||||
|
||||
Reference in New Issue
Block a user