maquina 0.2.3 → 0.2.5

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: b7ab60b2cea0b2831706a45cfc1978c870cd116e8cbffa0b7e1c2571c07f2f00
4
- data.tar.gz: 1dc50dfe21922c104bcf39dafb4d9c48c56005b8ac699c2539182cb4bc1460ed
3
+ metadata.gz: 31ab94ae292dc94ebccc7ad33cd520b29a8bd945620f4d698239a6fec7a686a3
4
+ data.tar.gz: ee06ac7e22a088a2386cf3ca2d6f83aa3d4cff47102c22efaa495b464ac2cf97
5
5
  SHA512:
6
- metadata.gz: b6c5e01ae51066b823f75a917cd7241175f339c80e490a1279b1cfc2ff590ee3bbd065eb080e0113ac539e84802b43eb81c60a2cfd56271e94222dc5f94f725d
7
- data.tar.gz: 40bb78e88253d90fcc01af052e767a8b1d44dfdb05b14c360d099bfa5dd9a134f13b03c04ae8b29bb588407c0cb64ed04963a655f2058edac131ed3987ffb95d
6
+ metadata.gz: 53eb9e8dee812c60f8c33c770dc8c0a6ad4543f55d29be3c3aa2613f166578392bab79b446e119e135f6a90f846d85ef84d39b23a820ae6cd80e3bcdf00939e7
7
+ data.tar.gz: c62d7bec012895f8feca619c6c753e97e4cf27d4fcb3e1f58e79f1d14d403efd55ec4257fdda5d7f70cadc80b8c6acfef84f136fa3b93d902b1f56a5f6e2cb0e
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- maquina (0.2.3)
4
+ maquina (0.2.5)
5
5
  action_policy (~> 0.6.3)
6
6
  bcrypt (~> 3.1.7)
7
7
  importmap-rails (~> 1.2.0)
@@ -16,7 +16,6 @@ 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
20
19
  response.status = @status
21
20
  set_flash_message(@status)
22
21
 
@@ -7,7 +7,7 @@ module Maquina
7
7
  included do
8
8
  def edit(&block)
9
9
  @resource ||= begin
10
- scope = resource_class
10
+ scope = resource_class.all
11
11
  scope = authorized_scope(scope) if policy_class.present?
12
12
  scope = yield(scope) if block.present?
13
13
 
@@ -65,9 +65,9 @@ module Maquina
65
65
  method_name = :secure_params
66
66
  method_action_name = "#{action_name}_#{method_name}".to_sym
67
67
 
68
- if respond_to?(method_action_name)
68
+ if respond_to?(method_action_name, true)
69
69
  send(method_action_name)
70
- elsif respond_to?(method_name)
70
+ elsif respond_to?(method_name, true)
71
71
  send(method_name)
72
72
  else
73
73
  params.require(resource_class.model_name.element.to_sym).permit(form_attributes.flat_map { |field| field.keys })
@@ -7,7 +7,7 @@ module Maquina
7
7
  included do
8
8
  def update(&block)
9
9
  @resource ||= begin
10
- scope = resource_class
10
+ scope = resource_class.all
11
11
  scope = authorized_scope(scope) if policy_class.present?
12
12
 
13
13
  resource = scope.find_by!(find_by_param => params[:id])
@@ -20,7 +20,6 @@ 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
24
23
  response.status = status
25
24
  set_flash_message(status)
26
25
 
@@ -1,3 +1,3 @@
1
1
  module Maquina
2
- VERSION = "0.2.3"
2
+ VERSION = "0.2.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: maquina
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mario Alberto Chávez