simple_workflow 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,3 +1,10 @@
1
+ == 0.2.0 2012-03-06
2
+
3
+ === Features
4
+
5
+ * Allow overriding the return point in the with_detour method
6
+
7
+
1
8
  == 0.1.1 2012-03-06
2
9
 
3
10
  === Features
@@ -9,18 +9,18 @@ module SimpleWorkflow::Helper
9
9
  link_to title, with_detour(options), html_options
10
10
  end
11
11
 
12
- def with_detour(options)
13
- detour_options = {:detour => params.reject { |k, v| [:detour, :return_from_detour].include? k.to_sym }}
12
+ def with_detour(options, back_options = {})
13
+ detour_options = {:detour => (params.merge(back_options)).reject { |k, v| [:detour, :return_from_detour].include? k.to_sym }}
14
14
  if options.is_a? String
15
15
  return options + (options =~ /\?/ ? '&' : '?') + detour_options[:detour].map{|k,v| "detour[#{k}]=#{v}"}.join('&')
16
16
  else
17
17
  detour_options.update(options)
18
18
  if options[:layout] == false
19
- if params[:action] !~ /_no_layout$/
20
- detour_options[:detour].update({:action => params[:action] + '_no_layout'})
19
+ if detour_options[:action] !~ /_no_layout$/
20
+ detour_options[:detour].update({:action => detour_options[:action] + '_no_layout'})
21
21
  end
22
22
  elsif params[:action] =~ /_no_layout$/
23
- detour_options[:detour].update({:action => params[:action][0..-11]})
23
+ detour_options[:detour].update({:action => detour_options[:action][0..-11]})
24
24
  end
25
25
  detour_options
26
26
  end
@@ -1,3 +1,3 @@
1
1
  module SimpleWorkflow
2
- VERSION = '0.1.1'
2
+ VERSION = '0.2.0'
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_workflow
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 23
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 1
9
- - 1
10
- version: 0.1.1
8
+ - 2
9
+ - 0
10
+ version: 0.2.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Uwe Kubosch