summaryrefslogtreecommitdiff
path: root/app/controllers
diff options
context:
space:
mode:
authorStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-02-11 16:52:52 +0100
committerStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-02-11 16:52:52 +0100
commitee80c0eb8b5e10fab0a41ee123b4f6f0ed689c4c (patch)
treebe39a26515c5219ee038c1f21e22f88bc005e054 /app/controllers
parentc5b10519dd1ade04a25c43b100c15deb7e39b6d0 (diff)
parentda362f73cf417aa2eda9124d17c66850087ea0f6 (diff)
Merge branch 'backup' into develop
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/backup_jobs_controller.rb15
-rw-r--r--app/controllers/tenants_controller.rb1
2 files changed, 11 insertions, 5 deletions
diff --git a/app/controllers/backup_jobs_controller.rb b/app/controllers/backup_jobs_controller.rb
index 4f242ba..31b9c21 100644
--- a/app/controllers/backup_jobs_controller.rb
+++ b/app/controllers/backup_jobs_controller.rb
@@ -4,29 +4,34 @@ class BackupJobsController < ApplicationController
before_filter :spread_breadcrumbs
def index
- # @backup_jobs = BackupJob.all
end
def show
- # @backup_job = BackupJob.find(params[:id])
end
def new
- @backup_job = BackupJob.new
+ # Do the same as create.
+ #
+ @backup_job = BackupJob.new(:started_at => Time.now)
+
+ if @backup_job.save
+ redirect_to backup_jobs_path, :notice => t('backup_jobs.controller.successfuly_created')
+ else
+ render :new
+ end
end
def create
@backup_job = BackupJob.new(:started_at => Time.now)
if @backup_job.save
- redirect_to @backup_job, :notice => t('backup_jobs.controller.successfuly_created')
+ redirect_to backup_jobs_path, :notice => t('backup_jobs.controller.successfuly_created')
else
render :new
end
end
def destroy
- # @backup_job = BackupJob.find(params[:id])
@backup_job.destroy
redirect_to backup_jobs_url, :notice => t('backup_jobs.controller.successfuly_destroyed')
end
diff --git a/app/controllers/tenants_controller.rb b/app/controllers/tenants_controller.rb
index f30246b..b6a96b7 100644
--- a/app/controllers/tenants_controller.rb
+++ b/app/controllers/tenants_controller.rb
@@ -8,6 +8,7 @@ class TenantsController < ApplicationController
def show
@tenant = Tenant.find(params[:id])
@gateways = Gateway.order(:updated_at)
+ @backup_jobs = BackupJob.order(:finished_at).last(5)
end
def new