Force processes order
This commit is contained in:
@@ -4,7 +4,7 @@ class Admin::Legislation::ProcessesController < Admin::Legislation::BaseControll
|
|||||||
load_and_authorize_resource :process, class: "Legislation::Process"
|
load_and_authorize_resource :process, class: "Legislation::Process"
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@processes = ::Legislation::Process.send(@current_filter).page(params[:page])
|
@processes = ::Legislation::Process.send(@current_filter).order('id DESC').page(params[:page])
|
||||||
end
|
end
|
||||||
|
|
||||||
def create
|
def create
|
||||||
|
|||||||
@@ -19,9 +19,9 @@ class Legislation::Process < ActiveRecord::Base
|
|||||||
validates :allegations_end_date, presence: true
|
validates :allegations_end_date, presence: true
|
||||||
validates :final_publication_date, presence: true
|
validates :final_publication_date, presence: true
|
||||||
|
|
||||||
scope :open, -> {where("start_date <= ? and end_date >= ?", Date.current, Date.current) }
|
scope :open, -> { where("start_date <= ? and end_date >= ?", Date.current, Date.current).order('id DESC') }
|
||||||
scope :next, -> {where("start_date > ?", Date.current) }
|
scope :next, -> { where("start_date > ?", Date.current).order('id DESC') }
|
||||||
scope :past, -> {where("end_date < ?", Date.current) }
|
scope :past, -> { where("end_date < ?", Date.current).order('id DESC') }
|
||||||
|
|
||||||
def open_phase?(phase)
|
def open_phase?(phase)
|
||||||
today = Date.current
|
today = Date.current
|
||||||
|
|||||||
Reference in New Issue
Block a user