rao-resources_controller 0.0.49.pre → 0.0.50.pre
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/concerns/rao/resources_controller/aasm_concern.rb +18 -3
- data/config/locales/de.yml +1 -0
- data/config/locales/en.yml +1 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9a77482ef8736751ebab6c1ea43335f9c83b0df9b12e765956adb94ae366befe
|
4
|
+
data.tar.gz: 475e4173a5e082f3547532b233083b402741c46f1c14fd62ccbd7daeb700d1ef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8e8f943e0eb527ae4e4c27299334a094d66dd1dd4917c1d460862a0ddd058f0fc0c6481f9cb5160f72f501c73f56536ac4a597cbbbccb3babed15f61662a508f
|
7
|
+
data.tar.gz: 1de3255653c1cc23f8c804e8b6d1c83f3393d039970dfaa2b2c01204fdb29e1ce90f92a0b4dd5fc7ed1e3c9b51bebd2dfe203b338ffddb377019afc9f3c83e5e
|
@@ -8,11 +8,26 @@ module Rao
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def trigger_event
|
11
|
-
|
12
|
-
|
11
|
+
begin
|
12
|
+
result = @resource.aasm(permitted_params_for_trigger_event[:machine_name].to_sym).fire!(permitted_params_for_trigger_event[:event_name].to_sym)
|
13
|
+
rescue ActiveRecord::RecordInvalid => e
|
14
|
+
result = false
|
15
|
+
end
|
16
|
+
|
17
|
+
if result
|
18
|
+
flash[:notice] = t(
|
19
|
+
'rao.resources_controller.aasm_concern.trigger_event.success',
|
20
|
+
event: permitted_params_for_trigger_event[:event_name],
|
21
|
+
state: @resource.aasm(permitted_params_for_trigger_event[:machine_name].to_sym).current_state
|
22
|
+
)
|
13
23
|
else
|
14
|
-
flash[:
|
24
|
+
flash[:danger] = t(
|
25
|
+
'rao.resources_controller.aasm_concern.trigger_event.failure',
|
26
|
+
event: permitted_params_for_trigger_event[:event_name],
|
27
|
+
errors: @resource.errors.full_messages.to_sentence
|
28
|
+
)
|
15
29
|
end
|
30
|
+
|
16
31
|
redirect_back(fallback_location: root_path)
|
17
32
|
end
|
18
33
|
|
data/config/locales/de.yml
CHANGED
@@ -34,6 +34,7 @@ de:
|
|
34
34
|
resources_controller:
|
35
35
|
aasm_concern:
|
36
36
|
trigger_event:
|
37
|
+
failure: "Der Vorgang %{event} war nicht erfolgreich. Es traten folgende Fehler auf: %{errors}"
|
37
38
|
success: "Der Vorgang %{event} war erfolgreich. Der neue Status ist %{state}."
|
38
39
|
base:
|
39
40
|
form_buttons:
|
data/config/locales/en.yml
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rao-resources_controller
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.50.pre
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Roberto Vasquez Angel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-10-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -210,7 +210,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
210
210
|
- !ruby/object:Gem::Version
|
211
211
|
version: 1.3.1
|
212
212
|
requirements: []
|
213
|
-
rubygems_version: 3.4.
|
213
|
+
rubygems_version: 3.4.20
|
214
214
|
signing_key:
|
215
215
|
specification_version: 4
|
216
216
|
summary: Resources Controllers for Ruby on Rails.
|