rao-resources_controller 0.0.49.pre → 0.0.51.pre
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ed77f13d64e453c1739f049490a162ecb6ae2692e773488fe2800e1d9706671a
|
4
|
+
data.tar.gz: 5e56b6a6b51aca5497681d3b30581fc0fe8d8db312ffa6923b44845c9b833587
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8ba4b9b0276212d1c74f18f69e1cd412d68f9f93afabf9e6656745c21785277c084da11b37c582ca561f4792c1b1667544698a7fd71d3536b08f4fc4fb7f7115
|
7
|
+
data.tar.gz: 8da548cadd086c29e6db291cc69f229d9d5fda29dba384c61d7a426e5310a359cef3c91df58d28bbfb3b62b5b303da0bcda7ed9ba9a0f09f4c5ce0c1d6d0693b
|
@@ -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
|
|
@@ -16,7 +16,7 @@ module Rao
|
|
16
16
|
|
17
17
|
def store_location
|
18
18
|
return if request.referer.nil?
|
19
|
-
truncate_location_history(
|
19
|
+
truncate_location_history(3)
|
20
20
|
logger.debug "[LocationHistoryConcern] Storing last location [#{request.referer}]"
|
21
21
|
location_history[Time.zone.now] = request.referer
|
22
22
|
end
|
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.51.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-28 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.21
|
214
214
|
signing_key:
|
215
215
|
specification_version: 4
|
216
216
|
summary: Resources Controllers for Ruby on Rails.
|