ref: refs/heads/basesystem
commit 1d19da0b8081e862ff05d3a2252f44e37107b474
Author: Josef Reidinger
Date: Thu Aug 20 12:22:43 2009 +0200
fix next step
---
.../app/controllers/basesystem_controller.rb | 2 +-
plugins/basesystem/app/models/basesystem.rb | 13 +++++++++++++
2 files changed, 14 insertions(+), 1 deletions(-)
diff --git a/plugins/basesystem/app/controllers/basesystem_controller.rb b/plugins/basesystem/app/controllers/basesystem_controller.rb
index fb2a5b9..311861f 100644
--- a/plugins/basesystem/app/controllers/basesystem_controller.rb
+++ b/plugins/basesystem/app/controllers/basesystem_controller.rb
@@ -11,7 +11,7 @@ class BasesystemController < ApplicationController
def update
@basesystem = Basesystem.find
- @basesystem.current = params[:basesystem][:current]
+ @basesystem.next_step params[:basesystem][:current]
@basesystem.save
render :index
end
diff --git a/plugins/basesystem/app/models/basesystem.rb b/plugins/basesystem/app/models/basesystem.rb
index 8eb27f5..f87cb1f 100644
--- a/plugins/basesystem/app/models/basesystem.rb
+++ b/plugins/basesystem/app/models/basesystem.rb
@@ -44,6 +44,19 @@ class Basesystem
return ret
end
+ def next_step (current)
+ if (current != @current) #concurent modification
+ return
+ end
+
+ index = @steps.index current
+ if index == (@steps.size -1)
+ @current = END_STRING
+ else
+ @current = @steps[index+1]
+ end
+ end
+
#stores to system Basesystem settings
def save
#check if current is valid
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org