effective_resources 2.32.0 → 2.33.0

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: a6ac2e641e8596cdcce840faf6fb901d7ca6394757e6f98eb7d8bbe30a30e23d
4
- data.tar.gz: beb65fb3bd8397e0a347b944fddcd271cf032553a07a1f5230fac5023f92cf36
3
+ metadata.gz: 6f5a25c6d8a3d00de7fc80b70dacf4558f2c0dc8241294ce276f6d31eda10a21
4
+ data.tar.gz: a7edbeb23f0ae8a5f772227c25fd8febe75d8b277440c3f10b4de42575c85a61
5
5
  SHA512:
6
- metadata.gz: 52920001d7999fd0fa0d4e7a6dea54193eb47ad4b0f5ea953375547292a2d06d3afc3b56f4e3355e1baf7a87406c4379b3b6b7bdb492f6047c8abe28fa37232d
7
- data.tar.gz: 221e98eb7e99f98a7690c9d0684416e4e8ed63e2a9e05a9c800609c653ec007425b74b1a4e5c7f13bdfc9f7a5aba7677d23ccd4a31a912fad285918a35878c91
6
+ metadata.gz: 7f44f4d9b43f1cfd93d567d3ed1ea12f68696acb2dbb328a07fa811eef0de797259912f936de1d016b333179baac47c22ec4773be3667245ea0b1bb0516bb3d9
7
+ data.tar.gz: 56d5924d9b63fb7b51be6b47eeb178a8ab6bb7eae501083b1e6077bb2145867750351a5233d6ff01e9ecbd8ebbcd9a80afb196aac0769d0c9e145960d3de659b
@@ -36,7 +36,7 @@ module Effective
36
36
  # submit :save, 'Save', success: -> { "#{resource} was saved okay!" }
37
37
  def submit(action, label, args = {})
38
38
  instance_exec do
39
- before_action { _insert_submit(action, label, args) }
39
+ prepend_before_action { _insert_submit(action, label, args) }
40
40
  end
41
41
  end
42
42
 
@@ -49,7 +49,7 @@ module Effective
49
49
  # button :decline, false
50
50
  def button(action, label = nil, args = {})
51
51
  instance_exec do
52
- before_action { _insert_button(action, label, args) }
52
+ prepend_before_action { _insert_button(action, label, args) }
53
53
  end
54
54
  end
55
55
 
@@ -57,7 +57,7 @@ module Effective
57
57
  # submit and buttons options will be merged ontop of these
58
58
  def on(action, args = {})
59
59
  instance_exec do
60
- before_action { _insert_on(action, args) }
60
+ prepend_before_action { _insert_on(action, args) }
61
61
  end
62
62
  end
63
63
 
@@ -29,7 +29,8 @@ module Effective
29
29
  # before_action :authorize_resource, only: [:show, :update]
30
30
  # Authorize the resource
31
31
  def authorize_resource
32
- EffectiveResources.authorize!(self, action_name.to_sym, resource)
32
+ action = (commit_action[:action] == :save ? action_name : commit_action[:action]).to_sym
33
+ EffectiveResources.authorize!(self, action, resource)
33
34
  end
34
35
 
35
36
  # before_action :assign_required_steps, only: [:show, :update]
@@ -1,3 +1,3 @@
1
1
  module EffectiveResources
2
- VERSION = '2.32.0'.freeze
2
+ VERSION = '2.33.0'.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: 2.32.0
4
+ version: 2.33.0
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: 2025-10-06 00:00:00.000000000 Z
11
+ date: 2025-11-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails