kaplan 0.1.0 → 0.1.1
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.
- data/lib/kaplan.rb +7 -1
- data/lib/kaplan/version.rb +1 -1
- metadata +4 -4
data/lib/kaplan.rb
CHANGED
@@ -153,7 +153,13 @@ module Kaplan
|
|
153
153
|
|
154
154
|
private
|
155
155
|
def insert_rows(rows, model)
|
156
|
-
rows.each
|
156
|
+
rows.each do |row|
|
157
|
+
record = model.new
|
158
|
+
# set attributes explicitly instead of just shoving them into .new
|
159
|
+
# in case 'id' is one of the attributes (which would get ignored otherwise)
|
160
|
+
row.each {|k,v| record.send("#{k}=", v) }
|
161
|
+
record.save!
|
162
|
+
end
|
157
163
|
end
|
158
164
|
|
159
165
|
def insert_rows_from_csv(lines, model)
|
data/lib/kaplan/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kaplan
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 25
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 1
|
10
|
+
version: 0.1.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Elliot Winkler
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-
|
18
|
+
date: 2010-12-21 00:00:00 -07:00
|
19
19
|
default_executable:
|
20
20
|
dependencies: []
|
21
21
|
|