active_scaffold_batch 3.4.0 → 3.4.5
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 +5 -5
- data/app/assets/stylesshets/{active_scaffold_batch.css → active_scaffold_batch.scss} +2 -2
- data/app/views/active_scaffold_overrides/_batch_create_form_body.html.erb +1 -1
- data/app/views/active_scaffold_overrides/_batch_create_form_horizontal_header.html.erb +1 -1
- data/app/views/active_scaffold_overrides/_batch_create_form_horizontal_record.html.erb +1 -1
- data/app/views/active_scaffold_overrides/_batch_update_form_body.html.erb +1 -1
- data/lib/active_scaffold/actions/batch_base.rb +3 -3
- data/lib/active_scaffold/actions/batch_create.rb +1 -1
- data/lib/active_scaffold/actions/batch_update.rb +2 -2
- data/lib/active_scaffold/config/batch_destroy.rb +1 -5
- data/lib/active_scaffold/helpers/batch_create_column_helpers.rb +10 -0
- data/lib/active_scaffold_batch/config/core.rb +7 -7
- data/lib/active_scaffold_batch/version.rb +1 -1
- metadata +10 -24
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: bad88227a4ac0b2587bb9c0cb3655fae85875efa4b6118c46ff20ca05339df6e
|
|
4
|
+
data.tar.gz: 710149c54582c7105cbd01b618e5bcdd74da32c8a554f2d5e5509ecb8b06aeb0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b7c94c565133d16d892545a4389eb1f7ebfafe390e1fbbc83c200178da4b18ca49ac5a85371cdac0e9d36a0498436c2364875cb72d4747e96076261cdb809895
|
|
7
|
+
data.tar.gz: 856bd4207754a2db7488d5e687b49bc6d361e741285784aeba73079fe76be281ec5502b2b66b25f22803cc76c02ff17ef795584bbd192e95cb8055904a3f1af5
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
border-top: 0;
|
|
10
10
|
}
|
|
11
11
|
.active-scaffold .multiple .form_record a.remove {
|
|
12
|
-
background-image: url("
|
|
12
|
+
background-image: image-url("active_scaffold/cross.png");
|
|
13
13
|
display: block;
|
|
14
14
|
font-weight: bold;
|
|
15
15
|
height: 16px;
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
.active-scaffold-header div.actions > a.batch_new {
|
|
28
28
|
background-position: 5px 50%;
|
|
29
29
|
background-repeat: no-repeat;
|
|
30
|
-
background-image: url("
|
|
30
|
+
background-image: image-url("active_scaffold/add.png");
|
|
31
31
|
margin: 0;
|
|
32
32
|
padding: 5px 5px 5px 25px;
|
|
33
33
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<li class="form-element">
|
|
4
4
|
<%= hidden_field_tag("batch_scope", (batch_scope || 'LISTED')) %>
|
|
5
5
|
</li>
|
|
6
|
-
<% columns.
|
|
6
|
+
<% columns.each_column(for: @record) do |column| %>
|
|
7
7
|
<% next unless column.association.nil? || column.association.belongs_to? %>
|
|
8
8
|
<% renders_as = column_renders_as(column) %>
|
|
9
9
|
<% if renders_as == :subsection -%>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<thead>
|
|
2
2
|
<tr>
|
|
3
|
-
<% columns.
|
|
3
|
+
<% columns.each_column(flatten: true) do |column| -%>
|
|
4
4
|
<% next if column_renders_as(column) == :hidden -%>
|
|
5
5
|
<th class="<%= 'required' if column.required? %>"><label><%= column.label %></label></th>
|
|
6
6
|
<% end -%>
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
</tr>
|
|
8
8
|
<% end %>
|
|
9
9
|
<tr class="form_record">
|
|
10
|
-
<% columns.
|
|
10
|
+
<% columns.each_column(flatten: true) do |column| -%>
|
|
11
11
|
<%
|
|
12
12
|
next if column_renders_as(column) == :hidden
|
|
13
13
|
next unless record.authorized_for?(:crud_type => :create, :column => column.name)
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<li class="form-element">
|
|
4
4
|
<%= render :partial => 'batch_update_form_attribute_scope' -%>
|
|
5
5
|
</li>
|
|
6
|
-
<% columns.
|
|
6
|
+
<% columns.each_column(for: @record) do |column| %>
|
|
7
7
|
<% next unless column.association.nil? || column.association.belongs_to? %>
|
|
8
8
|
<% renders_as = column_renders_as(column) %>
|
|
9
9
|
<% if renders_as == :subsection -%>
|
|
@@ -104,7 +104,7 @@ module ActiveScaffold::Actions
|
|
|
104
104
|
if respond_to? "#{action_name}_respond_to_xml", true
|
|
105
105
|
send("#{action_name}_respond_to_xml")
|
|
106
106
|
else
|
|
107
|
-
render :xml => response_object.to_xml(:only => active_scaffold_config.send(action_name).columns.
|
|
107
|
+
render :xml => response_object.to_xml(:only => active_scaffold_config.send(action_name).columns.visible_columns_names), :content_type => Mime::XML, :status => response_status
|
|
108
108
|
end
|
|
109
109
|
end
|
|
110
110
|
|
|
@@ -112,7 +112,7 @@ module ActiveScaffold::Actions
|
|
|
112
112
|
if respond_to? "#{action_name}_respond_to_json", true
|
|
113
113
|
send("#{action_name}_respond_to_json")
|
|
114
114
|
else
|
|
115
|
-
render :text => response_object.to_json(:only => active_scaffold_config.send(action_name).columns.
|
|
115
|
+
render :text => response_object.to_json(:only => active_scaffold_config.send(action_name).columns.visible_columns_names), :content_type => Mime::JSON, :status => response_status
|
|
116
116
|
end
|
|
117
117
|
end
|
|
118
118
|
|
|
@@ -120,7 +120,7 @@ module ActiveScaffold::Actions
|
|
|
120
120
|
if respond_to? "#{action_name}_respond_to_yaml", true
|
|
121
121
|
send("#{action_name}_respond_to_yaml")
|
|
122
122
|
else
|
|
123
|
-
render :text => Hash.from_xml(response_object.to_xml(:only => active_scaffold_config.send(action_name).columns.
|
|
123
|
+
render :text => Hash.from_xml(response_object.to_xml(:only => active_scaffold_config.send(action_name).columns.visible_columns_names)).to_yaml, :content_type => Mime::YAML, :status => response_status
|
|
124
124
|
end
|
|
125
125
|
end
|
|
126
126
|
|
|
@@ -212,7 +212,7 @@ module ActiveScaffold::Actions
|
|
|
212
212
|
def create_attribute_values_from_params(columns, attributes)
|
|
213
213
|
values = {}
|
|
214
214
|
parent_record = active_scaffold_config.model.new
|
|
215
|
-
columns.
|
|
215
|
+
columns.each_column(for: active_scaffold_config.model, crud_type: :create, flatten: true) do |column|
|
|
216
216
|
next unless attributes.has_key?(column.name)
|
|
217
217
|
if column == batch_create_by_column.to_sym
|
|
218
218
|
@batch_create_by_records = batch_values_for_column(column, attributes[column.name])
|
|
@@ -174,7 +174,7 @@ module ActiveScaffold::Actions
|
|
|
174
174
|
def update_attribute_values_from_params(columns, attributes)
|
|
175
175
|
values = {}
|
|
176
176
|
return values unless params_hash? attributes
|
|
177
|
-
columns.
|
|
177
|
+
columns.each_column(for: new_model, crud_type: :update, flatten: true) do |column|
|
|
178
178
|
next unless params_hash?(attributes[column.name]) && attributes[column.name][:operator] != 'NO_UPDATE'
|
|
179
179
|
value = attributes[column.name]
|
|
180
180
|
value[:value] = value[:operator] == 'NULL' ? nil : column_value_from_param_value(nil, column, value[:value])
|
|
@@ -244,7 +244,7 @@ module ActiveScaffold::Actions
|
|
|
244
244
|
current_value = record.send(column.name)
|
|
245
245
|
{"number"=>"", "unit"=>"DAYS", "value"=>"November 16, 2010", "operator"=>"REPLACE"}
|
|
246
246
|
if ActiveScaffold::Actions::BatchUpdate::GenericOperators.include?(calculation_info[:operator]) || ActiveScaffold::Actions::BatchUpdate::DateOperators.include?(calculation_info[:operator])
|
|
247
|
-
operand = self.class.condition_value_for_datetime(calculation_info[:value], column.column.type == :date ? :to_date : :to_time)
|
|
247
|
+
operand = self.class.condition_value_for_datetime(column, calculation_info[:value], column.column.type == :date ? :to_date : :to_time)
|
|
248
248
|
case calculation_info[:operator]
|
|
249
249
|
when 'REPLACE' then operand
|
|
250
250
|
when 'NULL' then nil
|
|
@@ -3,11 +3,7 @@ module ActiveScaffold::Config
|
|
|
3
3
|
self.crud_type = :delete
|
|
4
4
|
|
|
5
5
|
def initialize(core_config)
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
# start with the ActionLink defined globally
|
|
9
|
-
@link = self.class.link.map(&:clone) unless self.class.link.nil?
|
|
10
|
-
@action_group = self.class.action_group.clone if self.class.action_group
|
|
6
|
+
super
|
|
11
7
|
@action_group ||= 'collection.batch.destroy'
|
|
12
8
|
@process_mode = self.class.process_mode
|
|
13
9
|
end
|
|
@@ -35,6 +35,16 @@ module ActiveScaffold
|
|
|
35
35
|
def batch_create_multiple_layout
|
|
36
36
|
"batch_create_form_#{active_scaffold_config.batch_create.layout}"
|
|
37
37
|
end
|
|
38
|
+
|
|
39
|
+
def current_form_columns(record, scope, subform_controller = nil)
|
|
40
|
+
columns = super
|
|
41
|
+
return columns if columns
|
|
42
|
+
if %i[batch_new batch_create].include? action_name.to_sym
|
|
43
|
+
active_scaffold_config.batch_create.columns.visible_columns_names
|
|
44
|
+
elsif %i[batch_edit batch_update].include? action_name.to_sym
|
|
45
|
+
active_scaffold_config.batch_update.columns.visible_columns_names
|
|
46
|
+
end
|
|
47
|
+
end
|
|
38
48
|
end
|
|
39
49
|
end
|
|
40
50
|
end
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
# Need to open the AS module carefully due to Rails 2.3 lazy loading
|
|
2
2
|
ActiveScaffold::Config::Core.class_eval do
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
ActiveScaffold::Routing::ACTIVE_SCAFFOLD_CORE_ROUTING[:collection][:batch_edit] = :get
|
|
4
|
+
ActiveScaffold::Routing::ACTIVE_SCAFFOLD_CORE_ROUTING[:collection][:batch_update] = :post
|
|
5
|
+
ActiveScaffold::Routing::ACTIVE_SCAFFOLD_CORE_ROUTING[:collection][:batch_new] = :get
|
|
6
|
+
ActiveScaffold::Routing::ACTIVE_SCAFFOLD_CORE_ROUTING[:collection][:batch_create] = :post
|
|
7
|
+
ActiveScaffold::Routing::ACTIVE_SCAFFOLD_CORE_ROUTING[:collection][:batch_add] = :get
|
|
8
8
|
#not working because routing picks show route instead
|
|
9
|
-
#
|
|
9
|
+
#ActiveScaffold::Routing::ACTIVE_SCAFFOLD_CORE_ROUTING[:collection][:batch_destroy] = :get
|
|
10
10
|
#you may define a route for your controller before resource routes
|
|
11
11
|
#match 'players/batch_destroy' => 'players#batch_destroy', :via => [:get]
|
|
12
|
-
|
|
12
|
+
ActiveScaffold::Routing::ACTIVE_SCAFFOLD_CORE_ROUTING[:collection][:batch_destroy] = :delete
|
|
13
13
|
end
|
metadata
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: active_scaffold_batch
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.4.
|
|
4
|
+
version: 3.4.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Sergio Cambra
|
|
8
8
|
- Volker Hochstein
|
|
9
|
-
autorequire:
|
|
9
|
+
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date:
|
|
12
|
+
date: 2020-08-11 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: bundler
|
|
@@ -31,28 +31,14 @@ dependencies:
|
|
|
31
31
|
requirements:
|
|
32
32
|
- - ">="
|
|
33
33
|
- !ruby/object:Gem::Version
|
|
34
|
-
version: 3.
|
|
34
|
+
version: 3.6.0.pre
|
|
35
35
|
type: :runtime
|
|
36
36
|
prerelease: false
|
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
|
38
38
|
requirements:
|
|
39
39
|
- - ">="
|
|
40
40
|
- !ruby/object:Gem::Version
|
|
41
|
-
version: 3.
|
|
42
|
-
- !ruby/object:Gem::Dependency
|
|
43
|
-
name: rails
|
|
44
|
-
requirement: !ruby/object:Gem::Requirement
|
|
45
|
-
requirements:
|
|
46
|
-
- - ">="
|
|
47
|
-
- !ruby/object:Gem::Version
|
|
48
|
-
version: '4.0'
|
|
49
|
-
type: :runtime
|
|
50
|
-
prerelease: false
|
|
51
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
52
|
-
requirements:
|
|
53
|
-
- - ">="
|
|
54
|
-
- !ruby/object:Gem::Version
|
|
55
|
-
version: '4.0'
|
|
41
|
+
version: 3.6.0.pre
|
|
56
42
|
description: You want to destroy/update many records at once with activescaffold?
|
|
57
43
|
email: activescaffold@googlegroups.com
|
|
58
44
|
executables: []
|
|
@@ -64,7 +50,7 @@ files:
|
|
|
64
50
|
- README
|
|
65
51
|
- app/assets/javascripts/jquery/active_scaffold_batch.js
|
|
66
52
|
- app/assets/javascripts/prototype/active_scaffold_batch.js
|
|
67
|
-
- app/assets/stylesshets/active_scaffold_batch.
|
|
53
|
+
- app/assets/stylesshets/active_scaffold_batch.scss
|
|
68
54
|
- app/views/active_scaffold_overrides/_batch_create_form.html.erb
|
|
69
55
|
- app/views/active_scaffold_overrides/_batch_create_form_attribute.html.erb
|
|
70
56
|
- app/views/active_scaffold_overrides/_batch_create_form_body.html.erb
|
|
@@ -108,7 +94,7 @@ homepage: http://github.com/scambra/active_scaffold_batch
|
|
|
108
94
|
licenses:
|
|
109
95
|
- MIT
|
|
110
96
|
metadata: {}
|
|
111
|
-
post_install_message:
|
|
97
|
+
post_install_message:
|
|
112
98
|
rdoc_options: []
|
|
113
99
|
require_paths:
|
|
114
100
|
- lib
|
|
@@ -123,9 +109,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
123
109
|
- !ruby/object:Gem::Version
|
|
124
110
|
version: '0'
|
|
125
111
|
requirements: []
|
|
126
|
-
rubyforge_project:
|
|
127
|
-
rubygems_version: 2.
|
|
128
|
-
signing_key:
|
|
112
|
+
rubyforge_project:
|
|
113
|
+
rubygems_version: 2.7.9
|
|
114
|
+
signing_key:
|
|
129
115
|
specification_version: 4
|
|
130
116
|
summary: Batch Processing for ActiveScaffold
|
|
131
117
|
test_files: []
|