kaplan 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/lib/kaplan.rb +7 -1
  2. data/lib/kaplan/version.rb +1 -1
  3. metadata +4 -4
@@ -153,7 +153,13 @@ module Kaplan
153
153
 
154
154
  private
155
155
  def insert_rows(rows, model)
156
- rows.each {|row| model.create!(row) }
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)
@@ -1,3 +1,3 @@
1
1
  module Kaplan
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
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: 27
4
+ hash: 25
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 0
10
- version: 0.1.0
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-11-29 00:00:00 -07:00
18
+ date: 2010-12-21 00:00:00 -07:00
19
19
  default_executable:
20
20
  dependencies: []
21
21