activerecord-insert_many 0.2.2 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/activerecord-insert_many.gemspec +1 -1
- data/lib/activerecord/insert_many.rb +17 -2
- data/lib/activerecord/insert_many/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 26499d66ec045253bddd9bc7d7602b5cf8a3c882
|
4
|
+
data.tar.gz: 0837ff9eb27fef0043e55eb39d77ef350fe93f67
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 401c21bed238f15664a8d02aafef065f0f00e05575b7ad97e23407c9f3a085ae12bd273885398cda06897da809cc6ce4769ebe7927800c9c0ead10e05ff6e630
|
7
|
+
data.tar.gz: 5b5f291346c4eb639d1c6848e904d955bdcaa20102f5d70424235b7bedd985f86a30a2a338073d4aa9a53ffa543d26ee074f78cef1c8f4f052ea12f6b54f5d73
|
@@ -17,7 +17,7 @@ Gem::Specification.new do |spec|
|
|
17
17
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
18
18
|
spec.require_paths = ["lib"]
|
19
19
|
|
20
|
-
spec.add_dependency "activerecord"
|
20
|
+
spec.add_dependency "activerecord", ">= 5.0"
|
21
21
|
|
22
22
|
spec.add_development_dependency "bundler", "~> 1.10"
|
23
23
|
spec.add_development_dependency "rake", "~> 10.0"
|
@@ -19,8 +19,23 @@ module ActiveRecord
|
|
19
19
|
key_list = sample.map { |name, value| quote_column_name(name) }
|
20
20
|
|
21
21
|
value_lists = fixtures.map do |fixture|
|
22
|
-
|
23
|
-
|
22
|
+
|
23
|
+
binds = fixture.map do |name, value|
|
24
|
+
name = name.to_s
|
25
|
+
if column = columns[name]
|
26
|
+
type = lookup_cast_type_from_column(column)
|
27
|
+
Relation::QueryAttribute.new(name, value, type)
|
28
|
+
else
|
29
|
+
raise Fixture::FixtureError, %(table "#{table_name}" has no column named #{name.inspect}.)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
prepare_binds_for_database(binds).map do |value|
|
34
|
+
begin
|
35
|
+
quote(value)
|
36
|
+
rescue TypeError
|
37
|
+
quote(YAML.dump(value))
|
38
|
+
end
|
24
39
|
end
|
25
40
|
end
|
26
41
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activerecord-insert_many
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Luke Booth
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-
|
12
|
+
date: 2016-08-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activerecord
|
@@ -17,14 +17,14 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - ">="
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: '0'
|
20
|
+
version: '5.0'
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - ">="
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version: '0'
|
27
|
+
version: '5.0'
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: bundler
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
@@ -90,7 +90,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
90
90
|
version: '0'
|
91
91
|
requirements: []
|
92
92
|
rubyforge_project:
|
93
|
-
rubygems_version: 2.
|
93
|
+
rubygems_version: 2.5.1
|
94
94
|
signing_key:
|
95
95
|
specification_version: 4
|
96
96
|
summary: Adds a method for bulk-inserted records using ActiveRecord
|