active_scaffold_batch 3.5.0 → 3.5.2

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: e32cd2f2a255541e078e22730f232b92e185802ad7d641313fe3b272354ddf53
4
- data.tar.gz: d42cdc9ddf6f6d5a461e3cf2b7abec64502aa839776d7302807a7a6b869ed0e3
3
+ metadata.gz: 57996a4d8d4924a4d1dd7bea60e270cc86906312e3b98a806425e4b0742f248e
4
+ data.tar.gz: acb26347253ee5fa7f8babd740de40897ce9d8673f6c004aa36c8536459f85ef
5
5
  SHA512:
6
- metadata.gz: 1ab9e72e959c13dd367896fe9f00e48f17ae227739b94746391dfa4a9e4b1738983947dd8c6c2add37c90eddad814e470591fd2d30c76f201f3e408e0f15dc95
7
- data.tar.gz: 2d555a17a6e1bd929a2f6343cf49651db2a04672ab7e85fea85250d81b2c7acbad5dc6c673a0c7d5bc1cab7a8deea84cb0662558ea5c69eff67880e46d2bdceb
6
+ metadata.gz: b70ebd0b00056a6ad2a6432d179efa852deb037dd271c492bee28fc982743779d0a2df0d5e3cf5bded88aa7e6d5a5412a227a4829e5909052e99d90a3105db5a
7
+ data.tar.gz: ae11b116e3bd9195797bb0e00d57911c51433b329c7b7af3d58e902fc05955c2bda96d288fef118f722204ca13a9d4e041bf7b2dd759f13b6b86ae87317a6fea
@@ -199,7 +199,9 @@ module ActiveScaffold::Actions
199
199
  if successful?
200
200
  marked_records_parent.delete(created_by.id.to_s) if batch_scope == 'MARKED' && marked_records_parent
201
201
  elsif @record.errors[batch_create_by_column]
202
- @record.errors.messages[batch_create_by_column].map!{|e| "#{@record.send(batch_create_by_column)} #{e}"}
202
+ new_errors = @record.errors.messages[batch_create_by_column].map { |e| "#{@record.send(batch_create_by_column)} #{e}" }
203
+ @record.errors.delete(batch_create_by_column)
204
+ new_errors.each { |error| @record.errors.add batch_create_by_column, error }
203
205
  end
204
206
  error_records << @record unless successful? && !run_in_transaction?
205
207
  end
@@ -1,21 +1,21 @@
1
1
  module ActiveScaffoldBatch
2
2
  class Engine < ::Rails::Engine
3
- initializer("initialize_active_scaffold_batch", :after => "initialize_active_scaffold") do
4
- initializer 'active_scaffold_export.routes' do
5
- ActiveSupport.on_load :active_scaffold_routing do
6
- self::ACTIVE_SCAFFOLD_CORE_ROUTING[:collection][:batch_edit] = :get
7
- self::ACTIVE_SCAFFOLD_CORE_ROUTING[:collection][:batch_update] = :post
8
- self::ACTIVE_SCAFFOLD_CORE_ROUTING[:collection][:batch_new] = :get
9
- self::ACTIVE_SCAFFOLD_CORE_ROUTING[:collection][:batch_create] = :post
10
- self::ACTIVE_SCAFFOLD_CORE_ROUTING[:collection][:batch_add] = :get
11
- #not working because routing picks show route instead
12
- #self::ACTIVE_SCAFFOLD_CORE_ROUTING[:collection][:batch_destroy] = :get
13
- #you may define a route for your controller before resource routes
14
- #match 'players/batch_destroy' => 'players#batch_destroy', :via => [:get]
15
- self::ACTIVE_SCAFFOLD_CORE_ROUTING[:collection][:batch_destroy] = :delete
16
- end
3
+ initializer 'active_scaffold_batch.routes' do
4
+ ActiveSupport.on_load :active_scaffold_routing do
5
+ self::ACTIVE_SCAFFOLD_CORE_ROUTING[:collection][:batch_edit] = :get
6
+ self::ACTIVE_SCAFFOLD_CORE_ROUTING[:collection][:batch_update] = :post
7
+ self::ACTIVE_SCAFFOLD_CORE_ROUTING[:collection][:batch_new] = :get
8
+ self::ACTIVE_SCAFFOLD_CORE_ROUTING[:collection][:batch_create] = :post
9
+ self::ACTIVE_SCAFFOLD_CORE_ROUTING[:collection][:batch_add] = :get
10
+ #not working because routing picks show route instead
11
+ #self::ACTIVE_SCAFFOLD_CORE_ROUTING[:collection][:batch_destroy] = :get
12
+ #you may define a route for your controller before resource routes
13
+ #match 'players/batch_destroy' => 'players#batch_destroy', :via => [:get]
14
+ self::ACTIVE_SCAFFOLD_CORE_ROUTING[:collection][:batch_destroy] = :delete
17
15
  end
16
+ end
18
17
 
18
+ initializer("active_scaffold_batch.view") do
19
19
  ActiveSupport.on_load(:action_view) do
20
20
  begin
21
21
  include ActiveScaffold::Helpers::UpdateColumnHelpers
@@ -2,7 +2,7 @@ module ActiveScaffoldBatch
2
2
  module Version
3
3
  MAJOR = 3
4
4
  MINOR = 5
5
- PATCH = 0
5
+ PATCH = 2
6
6
 
7
7
  STRING = [MAJOR, MINOR, PATCH].compact.join('.')
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_scaffold_batch
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.5.0
4
+ version: 3.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sergio Cambra
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2024-04-05 00:00:00.000000000 Z
12
+ date: 2024-08-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: active_scaffold