pry-helper 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3a183f019f5bf5b3c3fe36d26687b5cd8d08f45d34ec628c734f08e35a8de8ed
4
- data.tar.gz: 4f9f94dc18258f514af2263e7b33fc2ab6d99dc13d3f6fa4903f75aa2b2dd94a
3
+ metadata.gz: 7ab10975f9a9c6efc69659a1fc9d569255054133ea0e2ab850221b0b31a5fe9a
4
+ data.tar.gz: 1babbcadacf238a127246209c0a14c797209adc66ad6c344f374f2b78450e0f4
5
5
  SHA512:
6
- metadata.gz: e62ec3a4851f8351f3d2d7bc0a235eb7fe5e8de501c8f48b76d36f2306629394edba6480dea3dc4a9051edb4577b390c3b508fc4601a726031c70cd861f3d68f
7
- data.tar.gz: bb27b6fe1389c76c6bfdb76b8dff54071366e10ba40eb829bc26e5202d94d96b28b42d8fc6d459cb9b5b19c10845e6063b17830fe15b25beec34d02ef9bfae1c
6
+ metadata.gz: 671f232aafe4fb6552ab56174c6c5ae21596ae80164db458c53582e27d52537d777974cb1c4772814e53cb2e54089c037fab0cffa8b21b4ef0723058df61231c
7
+ data.tar.gz: a910749311098da5b4dc185681eb42c756fee272b9448aaa2ff5f804159c7f9fc68c65347d639649e3601fa96adce320c6413936520c363a39aed8e8809447ae
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- pry-helper (0.1.0)
4
+ pry-helper (0.1.1)
5
5
  activerecord
6
6
  activesupport
7
7
  caxlsx
@@ -36,10 +36,8 @@ GEM
36
36
  concurrent-ruby (~> 1.0)
37
37
  marcel (1.0.2)
38
38
  method_source (1.0.0)
39
- mini_portile2 (2.8.0)
40
39
  minitest (5.16.3)
41
- nokogiri (1.13.8)
42
- mini_portile2 (~> 2.8.0)
40
+ nokogiri (1.13.8-x86_64-darwin)
43
41
  racc (~> 1.4)
44
42
  pry (0.14.1)
45
43
  coderay (~> 1.1)
@@ -105,6 +105,12 @@ module PryHelper
105
105
  @@models = []
106
106
 
107
107
  ActiveRecord::Base.connection.tap do |conn|
108
+ Rails.root.join("app/models").tap do |path|
109
+ Dir.glob("#{path}/**/*.rb").each do |file|
110
+ file_name = File.basename(file, '.rb')
111
+ file_name.classify.constantize
112
+ end
113
+ end
108
114
  defined_models = ::ApplicationRecord.descendants
109
115
  tables = conn.tables
110
116
  if conn.adapter_name == 'Mysql2'
@@ -124,7 +130,7 @@ module PryHelper
124
130
  tables.each do |table_name|
125
131
  table_comment = comments[table_name]
126
132
  primary_keys[table_name].tap do |pkey|
127
- table_name.camelize.tap do |const_name|
133
+ table_name.classify.camelize.tap do |const_name|
128
134
  const_name = 'Modul' if const_name == 'Module'
129
135
  const_name = 'Clazz' if const_name == 'Class'
130
136
  if model_class = defined_models.find { |m| m.table_name == table_name }
@@ -1,3 +1,3 @@
1
1
  module PryHelper
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pry-helper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Liu Xiang