effective_resources 1.12.3 → 1.12.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 47e241da2411f181fa4a176db6791e1416b861f38061c9186fdf595df78767e2
4
- data.tar.gz: 76dc05f7974a967a14c608161e9c57e90eb66a962f32ca923b4913bd1f4f15bb
3
+ metadata.gz: 78a62dc6fc911b14bbf9972a75a5a4efcb8c1be89f049c67698a8eef4d3c4c65
4
+ data.tar.gz: 236d6cd2e737b360d0678ca861804f7a07f841b88bf6180befef3f55e2a5194d
5
5
  SHA512:
6
- metadata.gz: 6dc99f690d6f2aa26bfa240df5d9b5887ff4811ecf834178269934c5ef35cdd195180cc137302a2d31dee371ca5d012077f8d0113d146410d76fc9f6b06d2723
7
- data.tar.gz: aebfd8aff7b492dbf304ae5be5b3c63d6432754b2272c4c77a0aff64e1685add92fa70dadc385589c56e0b55dfc430156a18a9945bdb22fa73488ec970bbba10
6
+ metadata.gz: 0f3030caa00296cc2aa2af8c33eeaf77ad6a7b3a08bd601a563c422e605f75f0d8ce8070f5c389c2267aca25d62fba94f391404ca8d6b2de9ce8182f0ce005cb
7
+ data.tar.gz: 0ceda0d79b3f8a0c9783c997c3ca40b05e00e046f4f22917560bf983b021a4b963fe7d8fc37ffcd8e996e671bdc67a9b31d0390a2fa6b074f221a7c3a17d500d
@@ -24,10 +24,13 @@ module Effective
24
24
  def update
25
25
  Rails.logger.info 'Processed by Effective::WizardController#update'
26
26
 
27
+ action = (commit_action[:action] == :save ? :update : commit_action[:action])
28
+ EffectiveResources.authorize!(self, action, resource)
29
+
27
30
  resource.assign_attributes(send(resource_params_method_name))
28
31
  assign_current_step
29
32
 
30
- save_wizard_resource(resource)
33
+ save_wizard_resource(resource, action)
31
34
  end
32
35
 
33
36
  end
@@ -4,12 +4,17 @@ module Effective
4
4
 
5
5
  def save_wizard_resource(resource, action = nil, options = {})
6
6
  was_new_record = resource.new_record?
7
- action ||= resource.respond_to?("#{step}!") ? step : :save
7
+
8
+ if action.blank? || action == :update
9
+ action = resource.respond_to?("#{step}!") ? step : :save
10
+ end
8
11
 
9
12
  if save_resource(resource, action)
10
13
  flash[:success] ||= options.delete(:success) || resource_flash(:success, resource, action)
11
14
 
12
15
  @skip_to ||= skip_to_step(resource)
16
+
17
+ @redirect_to ||= resource_redirect_path(resource, action) if specific_redirect_path?(action)
13
18
  @redirect_to ||= resource_wizard_path(resource, @skip_to) if was_new_record
14
19
 
15
20
  if @redirect_to
@@ -1,3 +1,3 @@
1
1
  module EffectiveResources
2
- VERSION = '1.12.3'.freeze
2
+ VERSION = '1.12.4'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_resources
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.12.3
4
+ version: 1.12.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-02-04 00:00:00.000000000 Z
11
+ date: 2022-02-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails