active_scaffold_batch_vho 3.0.3 → 3.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/active_scaffold_batch_vho.gemspec +5 -5
- data/lib/active_scaffold/actions/batch_create.rb +6 -2
- data/lib/active_scaffold/actions/batch_update.rb +2 -2
- data/lib/active_scaffold_batch/locale/de.yml +3 -2
- data/lib/active_scaffold_batch/locale/en.yml +2 -1
- data/lib/active_scaffold_batch/version.rb +1 -1
- metadata +7 -7
data/Rakefile
CHANGED
@@ -22,7 +22,7 @@ Jeweler::Tasks.new do |gem|
|
|
22
22
|
gem.description = %Q{You want to destroy/update many records at once with activescaffold?}
|
23
23
|
gem.email = "activescaffold@googlegroups.com"
|
24
24
|
gem.authors = ["Volker Hochstein"]
|
25
|
-
gem.add_runtime_dependency 'active_scaffold_vho', '> 3.0.
|
25
|
+
gem.add_runtime_dependency 'active_scaffold_vho', '> 3.0.13'
|
26
26
|
# Include your dependencies below. Runtime dependencies are required when using your gem,
|
27
27
|
# and development dependencies are only needed for development (ie running rake tasks, tests, etc)
|
28
28
|
# gem.add_runtime_dependency 'jabber4r', '> 0.1'
|
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{active_scaffold_batch_vho}
|
8
|
-
s.version = "3.0.
|
8
|
+
s.version = "3.0.4"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Volker Hochstein"]
|
12
|
-
s.date = %q{2011-
|
12
|
+
s.date = %q{2011-03-05}
|
13
13
|
s.description = %q{You want to destroy/update many records at once with activescaffold?}
|
14
14
|
s.email = %q{activescaffold@googlegroups.com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -70,20 +70,20 @@ Gem::Specification.new do |s|
|
|
70
70
|
s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
|
71
71
|
s.add_development_dependency(%q<jeweler>, ["~> 1.5.2"])
|
72
72
|
s.add_development_dependency(%q<rcov>, [">= 0"])
|
73
|
-
s.add_runtime_dependency(%q<active_scaffold_vho>, ["> 3.0.
|
73
|
+
s.add_runtime_dependency(%q<active_scaffold_vho>, ["> 3.0.13"])
|
74
74
|
else
|
75
75
|
s.add_dependency(%q<shoulda>, [">= 0"])
|
76
76
|
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
77
77
|
s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
|
78
78
|
s.add_dependency(%q<rcov>, [">= 0"])
|
79
|
-
s.add_dependency(%q<active_scaffold_vho>, ["> 3.0.
|
79
|
+
s.add_dependency(%q<active_scaffold_vho>, ["> 3.0.13"])
|
80
80
|
end
|
81
81
|
else
|
82
82
|
s.add_dependency(%q<shoulda>, [">= 0"])
|
83
83
|
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
84
84
|
s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
|
85
85
|
s.add_dependency(%q<rcov>, [">= 0"])
|
86
|
-
s.add_dependency(%q<active_scaffold_vho>, ["> 3.0.
|
86
|
+
s.add_dependency(%q<active_scaffold_vho>, ["> 3.0.13"])
|
87
87
|
end
|
88
88
|
end
|
89
89
|
|
@@ -117,9 +117,13 @@ module ActiveScaffold::Actions
|
|
117
117
|
end
|
118
118
|
end
|
119
119
|
|
120
|
+
def new_batch_create_record
|
121
|
+
new_model
|
122
|
+
end
|
123
|
+
|
120
124
|
def create_record(batch_record)
|
121
125
|
@successful = nil
|
122
|
-
@record =
|
126
|
+
@record = new_batch_create_record
|
123
127
|
@record.send("#{batch_create_by_column.to_s}=", batch_record)
|
124
128
|
batch_create_values.each do |attribute, value|
|
125
129
|
set_record_attribute(value[:column], attribute, value[:value])
|
@@ -156,7 +160,7 @@ module ActiveScaffold::Actions
|
|
156
160
|
|
157
161
|
def attribute_values_from_params(columns, attributes)
|
158
162
|
values = {}
|
159
|
-
columns.each :for =>
|
163
|
+
columns.each :for => new_model, :crud_type => :create, :flatten => true do |column|
|
160
164
|
if batch_create_by_column == column.name
|
161
165
|
@batch_create_by_records = column_plural_assocation_value_from_value(column, attributes[column.name])
|
162
166
|
else
|
@@ -162,7 +162,7 @@ module ActiveScaffold::Actions
|
|
162
162
|
set_record_attribute(value[:column], attribute, value[:value])
|
163
163
|
end
|
164
164
|
|
165
|
-
update_save
|
165
|
+
update_save({:no_record_param_update => true})
|
166
166
|
if successful?
|
167
167
|
@record.marked = false if batch_scope == 'MARKED'
|
168
168
|
else
|
@@ -206,7 +206,7 @@ module ActiveScaffold::Actions
|
|
206
206
|
|
207
207
|
def attribute_values_from_params(columns, attributes)
|
208
208
|
values = {}
|
209
|
-
columns.each :for =>
|
209
|
+
columns.each :for => new_model, :crud_type => :update, :flatten => true do |column|
|
210
210
|
values[column.name] = {:column => column, :value => attributes[column.name].merge(:value => column_value_from_param_value(nil, column, attributes[column.name][:value]))} if selected_columns.include? column.name
|
211
211
|
end
|
212
212
|
values
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_scaffold_batch_vho
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 15
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 3
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 3.0.
|
9
|
+
- 4
|
10
|
+
version: 3.0.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Volker Hochstein
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-03-05 00:00:00 +01:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -86,12 +86,12 @@ dependencies:
|
|
86
86
|
requirements:
|
87
87
|
- - ">"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
hash:
|
89
|
+
hash: 29
|
90
90
|
segments:
|
91
91
|
- 3
|
92
92
|
- 0
|
93
|
-
-
|
94
|
-
version: 3.0.
|
93
|
+
- 13
|
94
|
+
version: 3.0.13
|
95
95
|
requirement: *id005
|
96
96
|
type: :runtime
|
97
97
|
description: You want to destroy/update many records at once with activescaffold?
|