active_scaffold_batch 3.3.1 → 3.3.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ Yzg5MDMwN2IxZGQ5NjRjMzZkOGY0NzdmODYxNjYyNWEwOWQwM2FmMg==
5
+ data.tar.gz: !binary |-
6
+ OTE1M2JmNTlhMmZmNDg3MDNjOWQ2Yzc5MWI1ZjgwZGY0NWE4MWIxOA==
7
+ SHA512:
8
+ metadata.gz: !binary |-
9
+ ZDEzNDUzYTk5ZWIxMWQxNDU5OTFhN2RmM2UzOTJiNzgyNTNkNTllYTdlNGU2
10
+ ODg3NzA4NTA3OTY4M2JlNjkxNjVmMWNlMmQ3ZDVmMTQ3YmI3YzMzMWEzNmQz
11
+ OTJiOWU4N2Y3YzM0OThmYWRjN2Q4OWI3NjBlMDVjMDNmZmQ4ZDQ=
12
+ data.tar.gz: !binary |-
13
+ MTk1YjRkMTBjMTU0YTU1OTgyNjEzNDY4NmNkNGEzYzU3YjMwZDk4OGNjYmUw
14
+ MjJkOWIzZWQyZjkzOGRkMDcxNTI1MjliYzUxMDFhMzllYTBhOGEzMmU2N2U4
15
+ NDJjN2JjMGFmNjMwNWFmY2VlMGQxZDJmNDY4NmI5YWM2NWU5YTg=
@@ -1,8 +1,10 @@
1
1
  <% if @error_records.present? && @error_records.is_a?(Array) -%>
2
2
  <%= render :partial => 'messages' unless request.xhr? %>
3
3
 
4
+ <% id_column = active_scaffold_config.model.human_attribute_name(batch_create_by_column) if batch_create_by_column && active_scaffold_config.columns[batch_create_by_column].association.nil? %>
4
5
  <% @error_records.each do |record| %>
5
- <%= active_scaffold_error_messages_for record, :object_name => "#{record.class.model_name.human.downcase}#{record.new_record? ? '' : ": #{record.to_label}"}" %>
6
+ <% record_title = record.new_record? ? (id_column ? "(#{id_column} #{record.send(batch_create_by_column)})" : '') : record.to_label %>
7
+ <%= active_scaffold_error_messages_for record, :object_name => "#{record.class.model_name.human.downcase} #{record_title}" %>
6
8
  <% end %>
7
9
  <% else %>
8
10
  <%= render :super %>
@@ -101,7 +101,7 @@ module ActiveScaffold::Actions
101
101
  if @marked_records_parent.nil?
102
102
  @marked_records_parent = if params[:batch_create_by]
103
103
  session_parent = active_scaffold_session_storage(params[:batch_create_by])
104
- session_parent[:marked_records] || {}
104
+ session_parent['marked_records'] || {}
105
105
  else
106
106
  false
107
107
  end
@@ -198,6 +198,8 @@ module ActiveScaffold::Actions
198
198
  end
199
199
  if successful?
200
200
  marked_records_parent.delete(created_by.id.to_s) if batch_scope == 'MARKED' && marked_records_parent
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}"}
201
203
  end
202
204
  error_records << @record unless successful? && !run_in_transaction?
203
205
  end
@@ -224,10 +226,10 @@ module ActiveScaffold::Actions
224
226
  if column.association
225
227
  column_plural_assocation_value_from_value(column, value)
226
228
  else
227
- value.split
229
+ value.lines.map(&:chomp)
228
230
  end
229
231
  end
230
-
232
+
231
233
  # The default security delegates to ActiveRecordPermissions.
232
234
  # You may override the method to customize.
233
235
  def batch_create_authorized?(record = nil)
@@ -49,7 +49,7 @@ module ActiveScaffold::Actions
49
49
  @successful = nil
50
50
  @record = record
51
51
 
52
- do_destroy
52
+ do_destroy(record)
53
53
  if successful?
54
54
  @record.as_marked = false if batch_scope == 'MARKED'
55
55
  else
@@ -2,7 +2,7 @@ module ActiveScaffoldBatch
2
2
  module Version
3
3
  MAJOR = 3
4
4
  MINOR = 3
5
- PATCH = 1
5
+ PATCH = 2
6
6
 
7
7
  STRING = [MAJOR, MINOR, PATCH].compact.join('.')
8
8
  end
metadata CHANGED
@@ -1,48 +1,39 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: active_scaffold_batch
3
- version: !ruby/object:Gem::Version
4
- hash: 9
5
- prerelease:
6
- segments:
7
- - 3
8
- - 3
9
- - 1
10
- version: 3.3.1
3
+ version: !ruby/object:Gem::Version
4
+ version: 3.3.2
11
5
  platform: ruby
12
- authors:
6
+ authors:
13
7
  - Sergio Cambra
14
8
  - Volker Hochstein
15
9
  autorequire:
16
10
  bindir: bin
17
11
  cert_chain: []
18
-
19
- date: 2014-09-24 00:00:00 Z
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
22
- type: :runtime
23
- requirement: &id001 !ruby/object:Gem::Requirement
24
- none: false
25
- requirements:
26
- - - ">="
27
- - !ruby/object:Gem::Version
28
- hash: 11
29
- segments:
30
- - 3
31
- - 3
32
- - 0
33
- version: 3.3.0
34
- version_requirements: *id001
12
+ date: 2015-11-17 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
35
15
  name: active_scaffold
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - ! '>='
19
+ - !ruby/object:Gem::Version
20
+ version: 3.4.18
21
+ type: :runtime
36
22
  prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - ! '>='
26
+ - !ruby/object:Gem::Version
27
+ version: 3.4.18
37
28
  description: You want to destroy/update many records at once with activescaffold?
38
29
  email: activescaffold@googlegroups.com
39
30
  executables: []
40
-
41
31
  extensions: []
42
-
43
- extra_rdoc_files:
32
+ extra_rdoc_files:
33
+ - README
34
+ files:
35
+ - LICENSE.txt
44
36
  - README
45
- files:
46
37
  - app/assets/javascripts/jquery/active_scaffold_batch.js
47
38
  - app/assets/javascripts/prototype/active_scaffold_batch.js
48
39
  - app/assets/stylesshets/active_scaffold_batch.css
@@ -85,40 +76,28 @@ files:
85
76
  - lib/active_scaffold_batch/config/core.rb
86
77
  - lib/active_scaffold_batch/engine.rb
87
78
  - lib/active_scaffold_batch/version.rb
88
- - LICENSE.txt
89
- - README
90
79
  homepage: http://github.com/scambra/active_scaffold_batch
91
- licenses:
80
+ licenses:
92
81
  - MIT
82
+ metadata: {}
93
83
  post_install_message:
94
84
  rdoc_options: []
95
-
96
- require_paths:
85
+ require_paths:
97
86
  - lib
98
- required_ruby_version: !ruby/object:Gem::Requirement
99
- none: false
100
- requirements:
101
- - - ">="
102
- - !ruby/object:Gem::Version
103
- hash: 3
104
- segments:
105
- - 0
106
- version: "0"
107
- required_rubygems_version: !ruby/object:Gem::Requirement
108
- none: false
109
- requirements:
110
- - - ">="
111
- - !ruby/object:Gem::Version
112
- hash: 3
113
- segments:
114
- - 0
115
- version: "0"
87
+ required_ruby_version: !ruby/object:Gem::Requirement
88
+ requirements:
89
+ - - ! '>='
90
+ - !ruby/object:Gem::Version
91
+ version: '0'
92
+ required_rubygems_version: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ! '>='
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
116
97
  requirements: []
117
-
118
98
  rubyforge_project:
119
- rubygems_version: 1.8.29
99
+ rubygems_version: 2.4.4
120
100
  signing_key:
121
- specification_version: 3
101
+ specification_version: 4
122
102
  summary: Batch Processing for ActiveScaffold
123
103
  test_files: []
124
-