schema_to_scaffold 0.6.0 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d217eae1d1216171c48d2a9e4f81e745e97904fd
4
- data.tar.gz: 31cd5d0289dca2e3cea82cd8ed0f355b44bcb393
3
+ metadata.gz: 969b26b8110ec685804238daf7f835f6042a2df2
4
+ data.tar.gz: 3ec92373792c7a41f7188358b671c7818bf13c12
5
5
  SHA512:
6
- metadata.gz: 93dba12cbf032ef667a8d75b69a85484cf98eddc38b4dd64ca6df4750f9b8325663d78e864a2223e79141d5c62d59573ec41414b47f7a6b0589d6eed98a72baf
7
- data.tar.gz: 701b55eec70e9c4be75aa6630030fe4c00282d2a785a9d5b2f829141b557d53b36c771a13214f139bd506a56e4937c933f767a4b67393af30bd37957b4608070
6
+ metadata.gz: f86331efd7a173ae09b799557696246f27542753a04f85027d8cd4ef7d55768d42207e2fbfa4ed6b7d8aa475a9894dc7300e0f14496fdfd44c2d3a6f80279403
7
+ data.tar.gz: c29b7768f3c26d65958ddc6f1bafcb203cee995c04dc71fd410e2bc8b60611f5036a7c26713a558a485a600d979e7bc397df86a89ebb77e2071a4c90fc123540
@@ -0,0 +1,10 @@
1
+ # Change Log
2
+ All notable changes to this project will be documented in this file.
3
+
4
+ ## 0.6.0 - 2014-Nov-19
5
+ ### Added
6
+ - all fields ending with "_id" will be treated as reference ex: t.integer "manager_id" will parse to manager:references
7
+
8
+ ## 0.6.0 - 2014-Nov-19
9
+ ### Added
10
+ - this changelog
@@ -44,11 +44,19 @@ rescue
44
44
  end
45
45
 
46
46
  result = gets.strip
47
- binding.pry
48
- if result[0] == "*"
49
- tables = (0..schema.table_names.count-1).map{|i|i}
50
- else
51
- tables = [result.to_i]
47
+ begin
48
+ case result
49
+ when "*"
50
+ tables = (0..schema.table_names.count-1).map{|i|i}
51
+ when /^\d/
52
+ tables = [result.to_i]
53
+ else
54
+ tables = eval(result).to_a.map{|i|i}
55
+ end
56
+ raise TypeError "the array returned empty" if tables.empty?
57
+ rescue Exception => e
58
+ puts "Not a valid input - #{e.message}"
59
+ #exit 1
52
60
  end
53
61
 
54
62
  script = []
@@ -1,6 +1,6 @@
1
1
  module SchemaToScaffold
2
2
  MAJOR = 0
3
3
  MINOR = 6
4
- REVISION = 0
4
+ REVISION = 1
5
5
  VERSION = [MAJOR, MINOR, REVISION].join('.')
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: schema_to_scaffold
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - João Soares
@@ -63,6 +63,7 @@ extra_rdoc_files: []
63
63
  files:
64
64
  - ".gitignore"
65
65
  - ".ruby-version"
66
+ - CHANGELOG.md
66
67
  - Gemfile
67
68
  - LICENSE.txt
68
69
  - README.md