Commit df24503b authored by Mario Manno's avatar Mario Manno

update controllers to new paper trail

parent e24b51a8
......@@ -15,6 +15,6 @@ class HomeController < ApplicationController
end
return redirect_to cfp_root_path
end
@versions = Version.where(conference_id: @conference.id).includes(:item).order("created_at DESC").limit(5)
@versions = PaperTrail::Version.where(conference_id: @conference.id).includes(:item).order("created_at DESC").limit(5)
end
end
......@@ -5,7 +5,7 @@ class RecentChangesController < ApplicationController
def index
authorize! :manage, CallForPapers
@all_versions = Version.where(conference_id: @conference.id).order("created_at DESC")
@all_versions = PaperTrail::Version.where(conference_id: @conference.id).order("created_at DESC")
@versions = @all_versions.paginate(
page: page_param,
per_page: 25
......@@ -18,7 +18,7 @@ class RecentChangesController < ApplicationController
def show
authorize! :manage, CallForPapers
@version = Version.where(conference_id: @conference.id, id: params[:id]).first
@version = PaperTrail::Version.where(conference_id: @conference.id, id: params[:id]).first
end
end
......@@ -193,11 +193,11 @@ class Conference < ActiveRecord::Base
if self.timeslot_duration_changed? and self.events.count > 0
old_duration = self.timeslot_duration_was
factor = old_duration / self.timeslot_duration
Event.paper_trail_off
Event.paper_trail_off!
self.events.each do |event|
event.update_attributes(time_slots: event.time_slots * factor)
end
Event.paper_trail_on
Event.paper_trail_on!
end
end
......
......@@ -209,7 +209,7 @@ class StaticProgramExport
end
def unlock_schedule
Conference.paper_trail_off
Conference.paper_trail_off!
@conference.schedule_public = true
@conference.save!
end
......@@ -217,7 +217,7 @@ class StaticProgramExport
def lock_schedule
@conference.schedule_public = @original_schedule_public
@conference.save!
Conference.paper_trail_on
Conference.paper_trail_on!
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment