you can probably just use @script.stages here.
for that matter it would be more railsy to use @script.stages wherever you use @stages