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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/factory_bro.rb +4 -4
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 59a75451c5f0e7cb6413f88c1880be8fc307da79
4
- data.tar.gz: 78fa6608aa32483b46a6dbae9aae9caddaab8800
3
+ metadata.gz: 1afbb0f6e03ea7f0298e5a5f2c3c872b12da82fa
4
+ data.tar.gz: f480b8106407249e60cacfbdb3c66de979d2c90a
5
5
  SHA512:
6
- metadata.gz: b312e1ffd77694d46cc426574dd76a2986b3259c8d90555415272b346009cbcf2a51dfd5a991f040c3e80f44309166114b7d8d6df01f1b2425836cd70457d4a7
7
- data.tar.gz: 080a2645b01f82a96b569a4d0786dbdcb485d71e9d70f29d5f32ddabe8a506f1c6dccee52886d42070ee79adcade03c64228a3ad34c32ff050d16cd13f9b4692
6
+ metadata.gz: 27c1f080c07cdbcc1e3957f447bcf2c66eab74a15d7b8e4687ec2a974e721a7cf404c0b89753b657af861eb09a644f303e81e11079485999a743e4ba102652f0
7
+ data.tar.gz: 5aca85f75b6a0be315abcc4912d7c407dd546ce6c45eff05eba14cd7ebb6c00b07de2f1226a76447e078f3ec8362762d786d4ba39a8da004816e973919d1c6a7
@@ -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.5
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-26 00:00:00.000000000 Z
11
+ date: 2016-10-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pg