active_scaffold_batch 3.3.0 → 3.3.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,4 @@
1
- <% if @error_records.present? && @record_errors.is_a?(Array) -%>
1
+ <% if @error_records.present? && @error_records.is_a?(Array) -%>
2
2
  <%= render :partial => 'messages' unless request.xhr? %>
3
3
 
4
4
  <% @error_records.each do |record| %>
@@ -132,7 +132,7 @@ module ActiveScaffold::Actions
132
132
  active_scaffold_config.model.transaction do
133
133
  processed_records, created_records = yield
134
134
  if processed_records == created_records
135
- @error_records.each { |_, record| create_save(record) } if validate_first?
135
+ @error_records.each { |key, record| create_save(record || key) } if validate_first?
136
136
  @error_records = []
137
137
  else
138
138
  created_records = 0
@@ -190,7 +190,12 @@ module ActiveScaffold::Actions
190
190
  end
191
191
 
192
192
  if authorized_for_job?(@record)
193
- create_save(@record)
193
+ if validate_first?
194
+ self.successful = [@record.valid?, @record.associated_valid?].all?
195
+ else
196
+ create_save(@record) rescue nil
197
+ self.successful = @record.persisted?
198
+ end
194
199
  if successful?
195
200
  marked_records_parent.delete(created_by.id.to_s) if batch_scope == 'MARKED' && marked_records_parent
196
201
  end
@@ -219,7 +224,7 @@ module ActiveScaffold::Actions
219
224
  if column.association
220
225
  column_plural_assocation_value_from_value(column, value)
221
226
  else
222
- value.split("\n")
227
+ value.split
223
228
  end
224
229
  end
225
230
 
@@ -67,7 +67,7 @@ module ActiveScaffold::Config
67
67
  attr_accessor :layout
68
68
 
69
69
  def action_group
70
- @action_group || (default_batch_by_column ? 'collection.group' : 'collection')
70
+ @action_group || (default_batch_by_column ? 'collection.batch' : 'collection')
71
71
  end
72
72
 
73
73
  # the label= method already exists in the Form base class
@@ -2,7 +2,7 @@ module ActiveScaffoldBatch
2
2
  module Version
3
3
  MAJOR = 3
4
4
  MINOR = 3
5
- PATCH = 0
5
+ PATCH = 1
6
6
 
7
7
  STRING = [MAJOR, MINOR, PATCH].compact.join('.')
8
8
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_scaffold_batch
3
3
  version: !ruby/object:Gem::Version
4
- hash: 11
4
+ hash: 9
5
5
  prerelease:
6
6
  segments:
7
7
  - 3
8
8
  - 3
9
- - 0
10
- version: 3.3.0
9
+ - 1
10
+ version: 3.3.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Sergio Cambra
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2014-09-22 00:00:00 Z
19
+ date: 2014-09-24 00:00:00 Z
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
22
  type: :runtime