effective_resources 1.8.30 → 1.8.31

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9b8d6506c26087d165eeca64882b229e482a7f3fe6a9afff2eec37aaa815e77f
4
- data.tar.gz: 5d18df3a0e9f53c9f454fae51bdf793c1e508d42bfe3d8e57c2613dc8cae0e59
3
+ metadata.gz: 2cac8ab4956bad6e580c5edfe77d2040d13430b327acff13874f0d447e2cb154
4
+ data.tar.gz: 9d2aeb097b2a71715aec44af86b49628549c0083ecd757f742047ae17842207b
5
5
  SHA512:
6
- metadata.gz: ddac7f1c308c8160b35d7dc0f5a33107e9f4ebe919aa38fbb13bfe5a059a1629634c7db4cf94535c9c18e8d3fa159932fd6443d774e24392049a2c18bf2f80ef
7
- data.tar.gz: 07a27078f7638d1f802de67bd46503c872e6c3ee515cb19008d447f340126332c201c7e3738ff0080e8a53e84dff2e0de1eb4e17769efe6275e4b6a8c0097de4
6
+ metadata.gz: c04ecb8170f56016f354a93dd1be925ac08cef0f9dc77b93027457fa30b3382907943083877f47daa6dc000e700be9594a69e52a69fe63a0846a1d988413876c
7
+ data.tar.gz: 73e362b25cc6acbc6c9abf0c8e8c87ad1a9b19d4a2d4c4e5f0a21cdc9f4071e8084ec15685fcb29a8d96bd1d9241c36f4d2569c79244247c3df8cd77eca2c333
data/README.md CHANGED
@@ -352,6 +352,8 @@ Here's `views/things/start.html.haml`:
352
352
 
353
353
  You can also call `render_wizard_sidebar(resource)` without the block syntax.
354
354
 
355
+ If you add `f.hidden_field(:skip_to_step, value: 'stepc')` you can control the next step.
356
+
355
357
  ## Testing
356
358
 
357
359
  Run tests by:
@@ -9,7 +9,7 @@ module Effective
9
9
  if save_resource(resource, action)
10
10
  flash[:success] ||= options.delete(:success) || resource_flash(:success, resource, action)
11
11
 
12
- @skip_to ||= resource.required_steps.find { |s| s == next_step } || resource.first_uncompleted_step
12
+ @skip_to ||= skip_to_step(resource)
13
13
  @redirect_to ||= resource_wizard_path(resource, @skip_to) if was_new_record
14
14
 
15
15
  redirect_to(@redirect_to || wizard_path(@skip_to))
@@ -19,6 +19,14 @@ module Effective
19
19
  end
20
20
  end
21
21
 
22
+ private
23
+
24
+ def skip_to_step(resource)
25
+ resource.skip_to_step ||
26
+ resource.required_steps.find { |s| s == next_step } ||
27
+ resource.first_uncompleted_step
28
+ end
29
+
22
30
  end
23
31
  end
24
32
  end
@@ -25,6 +25,8 @@ module ActsAsWizard
25
25
  acts_as_wizard_options = @acts_as_wizard_options
26
26
 
27
27
  attr_accessor :current_step
28
+ attr_accessor :skip_to_step
29
+
28
30
  attr_accessor :current_user
29
31
 
30
32
  if Rails.env.test? # So our tests can override the required_steps method
@@ -1,3 +1,3 @@
1
1
  module EffectiveResources
2
- VERSION = '1.8.30'.freeze
2
+ VERSION = '1.8.31'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_resources
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.30
4
+ version: 1.8.31
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect