seeder 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/seeder.rb +2 -2
- data/lib/seeder/version.rb +1 -1
- metadata +4 -4
data/lib/seeder.rb
CHANGED
@@ -30,7 +30,7 @@ class Seeder
|
|
30
30
|
end
|
31
31
|
|
32
32
|
def quote(value)
|
33
|
-
q = QUOTING[ActiveRecord::Base.connection.class.to_s] || "'
|
33
|
+
q = QUOTING[ActiveRecord::Base.connection.class.to_s] || '"'
|
34
34
|
"#{q}#{value}#{q}"
|
35
35
|
end
|
36
36
|
|
@@ -44,7 +44,7 @@ class Seeder
|
|
44
44
|
values = attributes.values_at(*relevant_keys)
|
45
45
|
|
46
46
|
if existing
|
47
|
-
|
47
|
+
updates = attributes.slice(*relevant_keys).map { |k,v| "#{quote(k)} = #{value_to_sql(v)}" }.join(", ")
|
48
48
|
conditions = keys.map { |k| "#{quote(k)} = #{value_to_sql(existing.send(k))}" }.join(" AND ")
|
49
49
|
%(UPDATE #{ar_model.table_name} SET #{updates} WHERE #{conditions})
|
50
50
|
else
|
data/lib/seeder/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: seeder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,11 +10,11 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2011-09-
|
13
|
+
date: 2011-09-19 00:00:00.000000000Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rspec
|
17
|
-
requirement: &
|
17
|
+
requirement: &2165235660 !ruby/object:Gem::Requirement
|
18
18
|
none: false
|
19
19
|
requirements:
|
20
20
|
- - ~>
|
@@ -22,7 +22,7 @@ dependencies:
|
|
22
22
|
version: 2.6.0
|
23
23
|
type: :development
|
24
24
|
prerelease: false
|
25
|
-
version_requirements: *
|
25
|
+
version_requirements: *2165235660
|
26
26
|
description: Keep your app's seed data in one file and update it easily, while respecting
|
27
27
|
key constraints
|
28
28
|
email: bsingh@wegowise.com
|