maquina 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/app/controllers/concerns/maquina/create.rb +1 -0
- data/app/controllers/concerns/maquina/destroy.rb +4 -3
- data/app/controllers/concerns/maquina/edit.rb +1 -2
- data/app/controllers/concerns/maquina/index.rb +1 -1
- data/app/controllers/concerns/maquina/update.rb +3 -2
- data/lib/maquina/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b7ab60b2cea0b2831706a45cfc1978c870cd116e8cbffa0b7e1c2571c07f2f00
|
4
|
+
data.tar.gz: 1dc50dfe21922c104bcf39dafb4d9c48c56005b8ac699c2539182cb4bc1460ed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b6c5e01ae51066b823f75a917cd7241175f339c80e490a1279b1cfc2ff590ee3bbd065eb080e0113ac539e84802b43eb81c60a2cfd56271e94222dc5f94f725d
|
7
|
+
data.tar.gz: 40bb78e88253d90fcc01af052e767a8b1d44dfdb05b14c360d099bfa5dd9a134f13b03c04ae8b29bb588407c0cb64ed04963a655f2058edac131ed3987ffb95d
|
data/Gemfile.lock
CHANGED
@@ -16,6 +16,7 @@ module Maquina
|
|
16
16
|
end
|
17
17
|
|
18
18
|
@status = @resource.errors.empty? ? :created : :unprocessable_entity
|
19
|
+
Rails.logger.debug "CREATE validation: #{@resource.errors.inspect}" if status == :unprocessable_entity
|
19
20
|
response.status = @status
|
20
21
|
set_flash_message(@status)
|
21
22
|
|
@@ -8,10 +8,11 @@ module Maquina
|
|
8
8
|
def destroy(&block)
|
9
9
|
@resource ||= begin
|
10
10
|
scope = resource_class
|
11
|
-
|
12
|
-
|
13
|
-
# TODO: Implement filtering by organization
|
11
|
+
scope = authorized_scope(scope) if policy_class.present?
|
12
|
+
|
14
13
|
scope.find_by!(find_by_param => params[:id])
|
14
|
+
|
15
|
+
authorize! resource, with: policy_class if policy_class.present?
|
15
16
|
end
|
16
17
|
|
17
18
|
@resource.destroy
|
@@ -8,8 +8,7 @@ module Maquina
|
|
8
8
|
def edit(&block)
|
9
9
|
@resource ||= begin
|
10
10
|
scope = resource_class
|
11
|
-
|
12
|
-
# scope = scope.where(organization)
|
11
|
+
scope = authorized_scope(scope) if policy_class.present?
|
13
12
|
scope = yield(scope) if block.present?
|
14
13
|
|
15
14
|
resource = scope.find_by!(find_by_param => params[:id])
|
@@ -14,7 +14,7 @@ module Maquina
|
|
14
14
|
scope = authorized_scope(scope) if policy_class.present?
|
15
15
|
|
16
16
|
search_value = params[:q]&.strip
|
17
|
-
scope = scope.search_full(search_value) if search_value.present?
|
17
|
+
scope = scope.search_full(search_value) if search_value.present? && resource_class.searchable?
|
18
18
|
|
19
19
|
scope = yield(scope) if block.present?
|
20
20
|
|
@@ -8,8 +8,8 @@ module Maquina
|
|
8
8
|
def update(&block)
|
9
9
|
@resource ||= begin
|
10
10
|
scope = resource_class
|
11
|
-
|
12
|
-
|
11
|
+
scope = authorized_scope(scope) if policy_class.present?
|
12
|
+
|
13
13
|
resource = scope.find_by!(find_by_param => params[:id])
|
14
14
|
|
15
15
|
authorize! resource, with: policy_class if policy_class.present?
|
@@ -20,6 +20,7 @@ module Maquina
|
|
20
20
|
saved = @resource.update(resource_secure_params)
|
21
21
|
|
22
22
|
status = saved ? :accepted : :unprocessable_entity
|
23
|
+
Rails.logger.debug "UPDATE validation: #{@resource.errors.inspect}" if status == :unprocessable_entity
|
23
24
|
response.status = status
|
24
25
|
set_flash_message(status)
|
25
26
|
|
data/lib/maquina/version.rb
CHANGED