factory_bro 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/factory_bro.rb +4 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1afbb0f6e03ea7f0298e5a5f2c3c872b12da82fa
|
4
|
+
data.tar.gz: f480b8106407249e60cacfbdb3c66de979d2c90a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 27c1f080c07cdbcc1e3957f447bcf2c66eab74a15d7b8e4687ec2a974e721a7cf404c0b89753b657af861eb09a644f303e81e11079485999a743e4ba102652f0
|
7
|
+
data.tar.gz: 5aca85f75b6a0be315abcc4912d7c407dd546ce6c45eff05eba14cd7ebb6c00b07de2f1226a76447e078f3ec8362762d786d4ba39a8da004816e973919d1c6a7
|
data/lib/factory_bro.rb
CHANGED
@@ -85,7 +85,7 @@ class FactoryBro
|
|
85
85
|
res.values.flatten # as array of column names
|
86
86
|
end
|
87
87
|
|
88
|
-
def self.parse_columns(table)
|
88
|
+
def self.parse_columns(name, table)
|
89
89
|
# hash this
|
90
90
|
res = $conns[name].exec("SELECT COLUMN_NAME, DATA_TYPE, CHARACTER_MAXIMUM_LENGTH
|
91
91
|
FROM INFORMATION_SCHEMA.COLUMNS
|
@@ -100,16 +100,16 @@ class FactoryBro
|
|
100
100
|
# remember:
|
101
101
|
# to return any needed metadata (i.e. ID)
|
102
102
|
# run other required bases before running method below
|
103
|
-
FactoryBro.generate_data(#{name}, '#{table}' , #{base_method_helper(table)})
|
103
|
+
FactoryBro.generate_data('#{name}', '#{table}' , #{base_method_helper(name, table)})
|
104
104
|
end
|
105
105
|
end
|
106
106
|
end
|
107
107
|
"
|
108
108
|
end
|
109
109
|
|
110
|
-
def self.base_method_helper(table)
|
110
|
+
def self.base_method_helper(name, table)
|
111
111
|
data = {}
|
112
|
-
parse_columns(table).each do |column|
|
112
|
+
parse_columns(name, table).each do |column|
|
113
113
|
data.merge!(column.first => auto_faker_assignment(column)) # idk if auto faker assignment is helping or a burden?
|
114
114
|
end
|
115
115
|
JSON.pretty_generate({ "factoryData" => data, "meta"=> {}})
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: factory_bro
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nate Reynolds
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-10-
|
11
|
+
date: 2016-10-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pg
|