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 +4 -4
- data/Gemfile.lock +2 -4
- data/lib/pry-helper/definition.rb +7 -1
- data/lib/pry-helper/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7ab10975f9a9c6efc69659a1fc9d569255054133ea0e2ab850221b0b31a5fe9a
|
4
|
+
data.tar.gz: 1babbcadacf238a127246209c0a14c797209adc66ad6c344f374f2b78450e0f4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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 }
|
data/lib/pry-helper/version.rb
CHANGED