simple_workflow 0.3.4 → 0.3.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -28,7 +28,7 @@ module SimpleWorkflow::Controller
28
28
  ss = ActiveSupport::Base64.encode64(Marshal.dump(session.to_hash)).size
29
29
  ws = ActiveSupport::Base64.encode64(Marshal.dump(session[:detours])).size
30
30
  break unless ws >= 2048 || (ss >= 3072 && session[:detours].size > 0)
31
- logger.info "Workflow too large (#{ws}). Dropping oldest detour."
31
+ logger.warn "Workflow too large (#{ws}). Dropping oldest detour."
32
32
  session[:detours].shift
33
33
  end
34
34
  logger.debug "Added detour: #{options.inspect}, session: #{ss} bytes, workflow(#{session[:detours].size}): #{ws} bytes"
@@ -11,19 +11,8 @@ module SimpleWorkflow::Helper
11
11
 
12
12
  def with_detour(options, back_options = {})
13
13
  detour_options = {:detour => (params.merge(back_options)).reject { |k, v| [:detour, :return_from_detour].include? k.to_sym }}
14
- if options.is_a? String
15
- return options + (options =~ /\?/ ? '&' : '?') + detour_options[:detour].map{|k,v| "detour[#{k}]=#{v}"}.join('&')
16
- else
17
- detour_options.update(options)
18
- if options[:layout] == false
19
- if detour_options[:action] !~ /_no_layout$/
20
- detour_options[:detour].update({:action => detour_options[:action] + '_no_layout'})
21
- end
22
- elsif params[:action] =~ /_no_layout$/
23
- detour_options[:detour].update({:action => detour_options[:action][0..-11]})
24
- end
25
- detour_options
26
- end
14
+ url = url_for(options) if options.respond_to? :to_param
15
+ return url + (url =~ /\?/ ? '&' : '?') + detour_options[:detour].map{|k,v| "detour[#{k}]=#{v}"}.join('&')
27
16
  end
28
17
 
29
18
  def image_detour_to(image_source, title, url_options, image_options = nil, link_options = nil)
@@ -1,3 +1,3 @@
1
1
  module SimpleWorkflow
2
- VERSION = '0.3.4'
2
+ VERSION = '0.3.5'
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: 27
4
+ hash: 25
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- - 4
10
- version: 0.3.4
9
+ - 5
10
+ version: 0.3.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Uwe Kubosch
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-05-31 00:00:00 Z
18
+ date: 2012-11-22 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: rails
@@ -81,7 +81,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
81
81
  requirements: []
82
82
 
83
83
  rubyforge_project: ruby-shoppe
84
- rubygems_version: 1.8.21
84
+ rubygems_version: 1.8.24
85
85
  signing_key:
86
86
  specification_version: 3
87
87
  summary: Add simple "detour" workflow to Ruby On Rails.