common_core_js 0.4.2 → 0.4.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +113 -78
- data/README.md +33 -0
- data/common_core_js.gemspec +3 -9
- data/lib/common_core_js/version.rb +1 -1
- data/lib/generators/common_core/scaffold_generator.rb +31 -20
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 34c76baa6457d9e7647a7f703c72c4403f99c8e713a9edb3eeab161fa5087dfc
|
4
|
+
data.tar.gz: 168c7944599f096a31a35cec07168c019160dedf5d7713f271f5a4fab434bb4a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bbc731908589e37e2bc52aa0a49fbe639acbcdbfe85a4a50faaae730d119bce2c9b80caeb09f0898f4f64dbcab1eedbb78c8f3e0eb899790e984ad64e9b2cfe0
|
7
|
+
data.tar.gz: de536f01b261a6d79e67c7ed1bb54a38df3cc3fc62b6053f38eab0c778eb5031e8e6638d6fd1ab8e5147335b4349d189dc491c3dd4430a88316bf6adfccbd206
|
data/Gemfile.lock
CHANGED
@@ -1,77 +1,99 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
common_core_js (0.
|
4
|
+
common_core_js (0.4.5)
|
5
|
+
bootsnap
|
6
|
+
bootstrap
|
7
|
+
ffaker
|
8
|
+
font-awesome-rails
|
5
9
|
haml-rails
|
6
10
|
kaminari
|
7
11
|
rails
|
12
|
+
sass-rails
|
8
13
|
|
9
14
|
GEM
|
10
15
|
remote: https://rubygems.org/
|
11
16
|
specs:
|
12
|
-
actioncable (6.
|
13
|
-
actionpack (= 6.
|
17
|
+
actioncable (6.1.3)
|
18
|
+
actionpack (= 6.1.3)
|
19
|
+
activesupport (= 6.1.3)
|
14
20
|
nio4r (~> 2.0)
|
15
21
|
websocket-driver (>= 0.6.1)
|
16
|
-
actionmailbox (6.
|
17
|
-
actionpack (= 6.
|
18
|
-
activejob (= 6.
|
19
|
-
activerecord (= 6.
|
20
|
-
activestorage (= 6.
|
21
|
-
activesupport (= 6.
|
22
|
+
actionmailbox (6.1.3)
|
23
|
+
actionpack (= 6.1.3)
|
24
|
+
activejob (= 6.1.3)
|
25
|
+
activerecord (= 6.1.3)
|
26
|
+
activestorage (= 6.1.3)
|
27
|
+
activesupport (= 6.1.3)
|
22
28
|
mail (>= 2.7.1)
|
23
|
-
actionmailer (6.
|
24
|
-
actionpack (= 6.
|
25
|
-
actionview (= 6.
|
26
|
-
activejob (= 6.
|
29
|
+
actionmailer (6.1.3)
|
30
|
+
actionpack (= 6.1.3)
|
31
|
+
actionview (= 6.1.3)
|
32
|
+
activejob (= 6.1.3)
|
33
|
+
activesupport (= 6.1.3)
|
27
34
|
mail (~> 2.5, >= 2.5.4)
|
28
35
|
rails-dom-testing (~> 2.0)
|
29
|
-
actionpack (6.
|
30
|
-
actionview (= 6.
|
31
|
-
activesupport (= 6.
|
32
|
-
rack (~> 2.0, >= 2.0.
|
36
|
+
actionpack (6.1.3)
|
37
|
+
actionview (= 6.1.3)
|
38
|
+
activesupport (= 6.1.3)
|
39
|
+
rack (~> 2.0, >= 2.0.9)
|
33
40
|
rack-test (>= 0.6.3)
|
34
41
|
rails-dom-testing (~> 2.0)
|
35
42
|
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
36
|
-
actiontext (6.
|
37
|
-
actionpack (= 6.
|
38
|
-
activerecord (= 6.
|
39
|
-
activestorage (= 6.
|
40
|
-
activesupport (= 6.
|
43
|
+
actiontext (6.1.3)
|
44
|
+
actionpack (= 6.1.3)
|
45
|
+
activerecord (= 6.1.3)
|
46
|
+
activestorage (= 6.1.3)
|
47
|
+
activesupport (= 6.1.3)
|
41
48
|
nokogiri (>= 1.8.5)
|
42
|
-
actionview (6.
|
43
|
-
activesupport (= 6.
|
49
|
+
actionview (6.1.3)
|
50
|
+
activesupport (= 6.1.3)
|
44
51
|
builder (~> 3.1)
|
45
52
|
erubi (~> 1.4)
|
46
53
|
rails-dom-testing (~> 2.0)
|
47
54
|
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
48
|
-
activejob (6.
|
49
|
-
activesupport (= 6.
|
55
|
+
activejob (6.1.3)
|
56
|
+
activesupport (= 6.1.3)
|
50
57
|
globalid (>= 0.3.6)
|
51
|
-
activemodel (6.
|
52
|
-
activesupport (= 6.
|
53
|
-
activerecord (6.
|
54
|
-
activemodel (= 6.
|
55
|
-
activesupport (= 6.
|
56
|
-
activestorage (6.
|
57
|
-
actionpack (= 6.
|
58
|
-
activejob (= 6.
|
59
|
-
activerecord (= 6.
|
58
|
+
activemodel (6.1.3)
|
59
|
+
activesupport (= 6.1.3)
|
60
|
+
activerecord (6.1.3)
|
61
|
+
activemodel (= 6.1.3)
|
62
|
+
activesupport (= 6.1.3)
|
63
|
+
activestorage (6.1.3)
|
64
|
+
actionpack (= 6.1.3)
|
65
|
+
activejob (= 6.1.3)
|
66
|
+
activerecord (= 6.1.3)
|
67
|
+
activesupport (= 6.1.3)
|
60
68
|
marcel (~> 0.3.1)
|
61
|
-
|
69
|
+
mimemagic (~> 0.3.2)
|
70
|
+
activesupport (6.1.3)
|
62
71
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
63
|
-
i18n (>=
|
64
|
-
minitest (
|
65
|
-
tzinfo (~>
|
66
|
-
zeitwerk (~> 2.
|
72
|
+
i18n (>= 1.6, < 2)
|
73
|
+
minitest (>= 5.1)
|
74
|
+
tzinfo (~> 2.0)
|
75
|
+
zeitwerk (~> 2.3)
|
76
|
+
autoprefixer-rails (10.2.4.0)
|
77
|
+
execjs
|
78
|
+
bootsnap (1.7.2)
|
79
|
+
msgpack (~> 1.0)
|
80
|
+
bootstrap (4.6.0)
|
81
|
+
autoprefixer-rails (>= 9.1.0)
|
82
|
+
popper_js (>= 1.14.3, < 2)
|
83
|
+
sassc-rails (>= 2.0.0)
|
67
84
|
builder (3.2.4)
|
68
|
-
concurrent-ruby (1.1.
|
85
|
+
concurrent-ruby (1.1.8)
|
69
86
|
crass (1.0.6)
|
70
|
-
erubi (1.
|
87
|
+
erubi (1.10.0)
|
71
88
|
erubis (2.7.0)
|
89
|
+
execjs (2.7.0)
|
90
|
+
ffaker (2.17.0)
|
91
|
+
ffi (1.14.2)
|
92
|
+
font-awesome-rails (4.7.0.7)
|
93
|
+
railties (>= 3.2, < 7)
|
72
94
|
globalid (0.4.2)
|
73
95
|
activesupport (>= 4.2.0)
|
74
|
-
haml (5.1
|
96
|
+
haml (5.2.1)
|
75
97
|
temple (>= 0.8.0)
|
76
98
|
tilt
|
77
99
|
haml-rails (2.0.1)
|
@@ -85,7 +107,7 @@ GEM
|
|
85
107
|
haml (>= 4.0, < 6)
|
86
108
|
nokogiri (>= 1.6.0)
|
87
109
|
ruby_parser (~> 3.5)
|
88
|
-
i18n (1.8.
|
110
|
+
i18n (1.8.9)
|
89
111
|
concurrent-ruby (~> 1.0)
|
90
112
|
kaminari (1.2.1)
|
91
113
|
activesupport (>= 4.1.0)
|
@@ -99,7 +121,7 @@ GEM
|
|
99
121
|
activerecord
|
100
122
|
kaminari-core (= 1.2.1)
|
101
123
|
kaminari-core (1.2.1)
|
102
|
-
loofah (2.
|
124
|
+
loofah (2.9.0)
|
103
125
|
crass (~> 1.0.2)
|
104
126
|
nokogiri (>= 1.5.9)
|
105
127
|
mail (2.7.1)
|
@@ -109,61 +131,74 @@ GEM
|
|
109
131
|
method_source (1.0.0)
|
110
132
|
mimemagic (0.3.5)
|
111
133
|
mini_mime (1.0.2)
|
112
|
-
mini_portile2 (2.
|
113
|
-
minitest (5.14.
|
114
|
-
|
115
|
-
|
116
|
-
|
134
|
+
mini_portile2 (2.5.0)
|
135
|
+
minitest (5.14.3)
|
136
|
+
msgpack (1.4.2)
|
137
|
+
nio4r (2.5.5)
|
138
|
+
nokogiri (1.11.1)
|
139
|
+
mini_portile2 (~> 2.5.0)
|
140
|
+
racc (~> 1.4)
|
141
|
+
popper_js (1.16.0)
|
142
|
+
racc (1.5.2)
|
117
143
|
rack (2.2.3)
|
118
144
|
rack-test (1.1.0)
|
119
145
|
rack (>= 1.0, < 3)
|
120
|
-
rails (6.
|
121
|
-
actioncable (= 6.
|
122
|
-
actionmailbox (= 6.
|
123
|
-
actionmailer (= 6.
|
124
|
-
actionpack (= 6.
|
125
|
-
actiontext (= 6.
|
126
|
-
actionview (= 6.
|
127
|
-
activejob (= 6.
|
128
|
-
activemodel (= 6.
|
129
|
-
activerecord (= 6.
|
130
|
-
activestorage (= 6.
|
131
|
-
activesupport (= 6.
|
132
|
-
bundler (>= 1.
|
133
|
-
railties (= 6.
|
146
|
+
rails (6.1.3)
|
147
|
+
actioncable (= 6.1.3)
|
148
|
+
actionmailbox (= 6.1.3)
|
149
|
+
actionmailer (= 6.1.3)
|
150
|
+
actionpack (= 6.1.3)
|
151
|
+
actiontext (= 6.1.3)
|
152
|
+
actionview (= 6.1.3)
|
153
|
+
activejob (= 6.1.3)
|
154
|
+
activemodel (= 6.1.3)
|
155
|
+
activerecord (= 6.1.3)
|
156
|
+
activestorage (= 6.1.3)
|
157
|
+
activesupport (= 6.1.3)
|
158
|
+
bundler (>= 1.15.0)
|
159
|
+
railties (= 6.1.3)
|
134
160
|
sprockets-rails (>= 2.0.0)
|
135
161
|
rails-dom-testing (2.0.3)
|
136
162
|
activesupport (>= 4.2.0)
|
137
163
|
nokogiri (>= 1.6)
|
138
164
|
rails-html-sanitizer (1.3.0)
|
139
165
|
loofah (~> 2.3)
|
140
|
-
railties (6.
|
141
|
-
actionpack (= 6.
|
142
|
-
activesupport (= 6.
|
166
|
+
railties (6.1.3)
|
167
|
+
actionpack (= 6.1.3)
|
168
|
+
activesupport (= 6.1.3)
|
143
169
|
method_source
|
144
170
|
rake (>= 0.8.7)
|
145
|
-
thor (
|
146
|
-
rake (13.0.
|
147
|
-
ruby_parser (3.
|
171
|
+
thor (~> 1.0)
|
172
|
+
rake (13.0.3)
|
173
|
+
ruby_parser (3.15.1)
|
148
174
|
sexp_processor (~> 4.9)
|
149
|
-
|
175
|
+
sass-rails (6.0.0)
|
176
|
+
sassc-rails (~> 2.1, >= 2.1.1)
|
177
|
+
sassc (2.4.0)
|
178
|
+
ffi (~> 1.9)
|
179
|
+
sassc-rails (2.1.2)
|
180
|
+
railties (>= 4.0.0)
|
181
|
+
sassc (>= 2.0)
|
182
|
+
sprockets (> 3.0)
|
183
|
+
sprockets-rails
|
184
|
+
tilt
|
185
|
+
sexp_processor (4.15.2)
|
150
186
|
sprockets (4.0.2)
|
151
187
|
concurrent-ruby (~> 1.0)
|
152
188
|
rack (> 1, < 3)
|
153
|
-
sprockets-rails (3.2.
|
189
|
+
sprockets-rails (3.2.2)
|
154
190
|
actionpack (>= 4.0)
|
155
191
|
activesupport (>= 4.0)
|
156
192
|
sprockets (>= 3.0.0)
|
157
193
|
temple (0.8.2)
|
158
|
-
thor (1.0
|
159
|
-
thread_safe (0.3.6)
|
194
|
+
thor (1.1.0)
|
160
195
|
tilt (2.0.10)
|
161
|
-
tzinfo (
|
162
|
-
|
163
|
-
websocket-driver (0.7.
|
196
|
+
tzinfo (2.0.4)
|
197
|
+
concurrent-ruby (~> 1.0)
|
198
|
+
websocket-driver (0.7.3)
|
164
199
|
websocket-extensions (>= 0.1.0)
|
165
200
|
websocket-extensions (0.1.5)
|
166
|
-
zeitwerk (2.
|
201
|
+
zeitwerk (2.4.2)
|
167
202
|
|
168
203
|
PLATFORMS
|
169
204
|
ruby
|
data/README.md
CHANGED
@@ -293,6 +293,37 @@ environment.plugins.prepend('Provide',
|
|
293
293
|
module.exports = environment
|
294
294
|
|
295
295
|
```
|
296
|
+
# VERSION HISTORY
|
297
|
+
|
298
|
+
## 0.4.7
|
299
|
+
- fixes some problems with display labeling through active record associations (was using a funky syntax for this)
|
300
|
+
- significant improvments to error messaging, like:
|
301
|
+
|
302
|
+
if you don't have a `current_user` and you don't specify an auth or auth_identifier (and you aren't using `--god` mode), helpful hint:
|
303
|
+
|
304
|
+
"*** Oops: It looks like is no association from current_user to a class called Invoice. If your user is called something else, pass with flag auth=current_X where X is the model for your users as lowercase. Also, be sure to implement current_X as a method on your controller. (If you really don't want to implement a current_X on your controller and want me to check some other method for your current user, see the section in the docs for auth_identifier.) To make a controller that can read all records, specify with --god."
|
305
|
+
|
306
|
+
|
307
|
+
If an association is on a model but the assocition has no field that can be used to display its name, you get this hint:
|
308
|
+
|
309
|
+
"*** Oops: Can't find any column to use as the display label for the account association on the Invoice model . TODO: Please implement just one of: 1) name, 2) to_label, 3) full_name, 4) display_name, or 5) email directly on your Account model (either as database field or model methods), then RERUN THIS GENERATOR. (If more than one is implemented, the field to use will be chosen based on the rank here, e.g., if name is present it will be used; if not, I will look for a to_label, etc)"
|
310
|
+
|
311
|
+
## 0.4.6
|
312
|
+
|
313
|
+
- Fixes a bug that would happen if you had no nested args
|
314
|
+
|
315
|
+
## 0.4.2 - 0.4.5 - Oct 2020
|
316
|
+
|
317
|
+
- Not sure what I was doing here or why I made 3 releases on the same day(?)
|
318
|
+
- Several bugfixes happened during these iterations
|
319
|
+
|
320
|
+
## 0.3.0 - 0.4.1 - August 2020
|
321
|
+
|
322
|
+
- Solid beta release
|
323
|
+
|
324
|
+
## 0.2.0 - 0.1.1
|
325
|
+
|
326
|
+
- Alpha stage
|
296
327
|
|
297
328
|
|
298
329
|
# ACKNOWLEDGEMENTS
|
@@ -300,3 +331,5 @@ module.exports = environment
|
|
300
331
|
### "POOR MAN"
|
301
332
|
|
302
333
|
I hope one day I will leave this Earth a poor man (like my code) owning only the most simple structure for the simple form of my existence. Thanks for having educated me in this wisdom goes to my former mentor [@trak3r](https://github.com/trak3r)!
|
334
|
+
|
335
|
+
|
data/common_core_js.gemspec
CHANGED
@@ -7,17 +7,13 @@ require 'byebug'
|
|
7
7
|
Gem::Specification.new do |spec|
|
8
8
|
spec.name = "common_core_js"
|
9
9
|
spec.version = CommonCoreJs::VERSION
|
10
|
-
spec.license = '
|
10
|
+
spec.license = 'Commit to Social Justice'
|
11
11
|
spec.date = '2020-10-29'
|
12
12
|
spec.summary = "A gem build scaffolding."
|
13
13
|
spec.description = "Simple, plug & play Rails scaffolding with really simple Javascript"
|
14
14
|
spec.authors = ["Jason Fleetwood-Boldt"]
|
15
15
|
spec.email = 'jason.fb@datatravels.com'
|
16
16
|
|
17
|
-
spec.homepage = 'https://blog.jasonfleetwoodboldt.com/common-core-js/'
|
18
|
-
spec.metadata = { "source_code_uri" => "https://github.com/jasonfb/common_core_js",
|
19
|
-
"course_material_uri" => "https://jfb.teachable.com/p/jason-s-open-source-work/"}
|
20
|
-
|
21
17
|
|
22
18
|
|
23
19
|
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
@@ -38,10 +34,8 @@ Gem::Specification.new do |spec|
|
|
38
34
|
spec.add_dependency "rails"
|
39
35
|
spec.homepage = 'https://blog.jasonfleetwoodboldt.com/common-core-js/'
|
40
36
|
spec.metadata = { "source_code_uri" => "https://github.com/jasonfb/common_core_js",
|
41
|
-
"documentation_uri" => "https://
|
42
|
-
"homepage_uri" => 'https://blog.jasonfleetwoodboldt.com/common-core-js/'
|
43
|
-
"mailing_list_uri" => 'https://blog.jasonfleetwoodboldt.com/#sfba-form2-container'
|
44
|
-
}
|
37
|
+
"documentation_uri" => "https://jfb.teachable.com/p/gems-by-jason",
|
38
|
+
"homepage_uri" => 'https://blog.jasonfleetwoodboldt.com/common-core-js/'}
|
45
39
|
|
46
40
|
spec.add_runtime_dependency('kaminari')
|
47
41
|
spec.add_runtime_dependency('haml-rails')
|
@@ -47,7 +47,7 @@ module CommonCore
|
|
47
47
|
begin
|
48
48
|
object = eval(class_name)
|
49
49
|
rescue StandardError => e
|
50
|
-
puts "
|
50
|
+
puts "*** Oops: It looks like there is no object for #{class_name}. Please define the object + database table first."
|
51
51
|
exit
|
52
52
|
end
|
53
53
|
|
@@ -68,7 +68,6 @@ module CommonCore
|
|
68
68
|
|
69
69
|
args[1..-1].each do |a|
|
70
70
|
var_name, var_value = a.split("=")
|
71
|
-
puts var_name
|
72
71
|
case (var_name)
|
73
72
|
|
74
73
|
when "plural"
|
@@ -108,7 +107,7 @@ module CommonCore
|
|
108
107
|
end
|
109
108
|
|
110
109
|
if @specs_only && @no_specs
|
111
|
-
puts "
|
110
|
+
puts "*** Oops: You seem to have specified both the --specs-only flag and --no-specs flags. this doesn't make any sense, so I am aborting. sorry."
|
112
111
|
exit
|
113
112
|
end
|
114
113
|
|
@@ -157,7 +156,11 @@ module CommonCore
|
|
157
156
|
if assoc
|
158
157
|
ownership_field = assoc.name.to_s + "_id"
|
159
158
|
else
|
160
|
-
|
159
|
+
if @auth
|
160
|
+
puts "*** Oops: It looks like is no association from current_#{@object_owner_sym} to a class called #{singular_class}. If your user is called something else, pass with flag auth=current_X where X is the model for your users as lowercase. Also, be sure to implement current_X as a method on your controller. (If you really don't want to implement a current_X on your controller and want me to check some other method for your current user, see the section in the docs for auth_identifier.) To make a controller that can read all records, specify with --god."
|
161
|
+
else
|
162
|
+
puts "*** Oops: god mode could not find the association(?). something is wrong."
|
163
|
+
end
|
161
164
|
exit
|
162
165
|
end
|
163
166
|
end
|
@@ -285,7 +288,11 @@ module CommonCore
|
|
285
288
|
end
|
286
289
|
|
287
290
|
def path_helper_args
|
288
|
-
|
291
|
+
if @nested_args.any?
|
292
|
+
[(@nested_args).collect{|a| "@#{a}"} , singular].join(",")
|
293
|
+
else
|
294
|
+
singular
|
295
|
+
end
|
289
296
|
end
|
290
297
|
|
291
298
|
def path_helper_singular
|
@@ -445,26 +452,27 @@ module CommonCore
|
|
445
452
|
puts "*** Oops. on the #{singular_class} object, there doesn't seem to be an association called '#{assoc_name}'"
|
446
453
|
exit
|
447
454
|
end
|
448
|
-
assoc_class_name = eval("#{singular_class}.reflect_on_association(:#{assoc_name})").class_name
|
449
455
|
|
450
|
-
|
456
|
+
|
457
|
+
assoc_class = eval(assoc.class_name)
|
458
|
+
|
459
|
+
if assoc_class.column_names.include?("name")
|
451
460
|
display_column = "name"
|
452
|
-
elsif
|
461
|
+
elsif assoc_class.column_names.include?("to_label")
|
453
462
|
display_column = "to_label"
|
454
|
-
elsif
|
463
|
+
elsif assoc_class.column_names.include?("full_name")
|
455
464
|
display_column = "full_name"
|
456
|
-
elsif
|
465
|
+
elsif assoc_class.column_names.include?("display_name")
|
457
466
|
display_column = "display_name"
|
458
|
-
elsif
|
467
|
+
elsif assoc_class.column_names.include?("email")
|
459
468
|
display_column = "email"
|
460
469
|
else
|
461
|
-
puts "Can't find
|
470
|
+
puts "*** Oops: Can't find any column to use as the display label for the #{assoc.name.to_s} association on the #{singular_class} model . TODO: Please implement just one of: 1) name, 2) to_label, 3) full_name, 4) display_name, or 5) email directly on your #{assoc.class_name} model (either as database field or model methods), then RERUN THIS GENERATOR. (If more than one is implemented, the field to use will be chosen based on the rank here, e.g., if name is present it will be used; if not, I will look for a to_label, etc)"
|
462
471
|
end
|
463
472
|
|
464
|
-
|
465
473
|
".row
|
466
474
|
%div{class: \"form-group col-md-4 \#{'alert-danger' if #{singular}.errors.details.keys.include?(:#{assoc_name.to_s})}\"}
|
467
|
-
= f.collection_select(:#{col.to_s}, #{
|
475
|
+
= f.collection_select(:#{col.to_s}, #{assoc_class}.all, :id, :#{display_column}, {prompt: true, selected: @#{singular}.#{col.to_s} }, class: 'form-control')
|
468
476
|
%label.small.form-text.text-muted
|
469
477
|
#{col.to_s.humanize}"
|
470
478
|
|
@@ -545,18 +553,21 @@ module CommonCore
|
|
545
553
|
exit
|
546
554
|
end
|
547
555
|
|
548
|
-
|
556
|
+
|
557
|
+
assoc_class = eval(assoc.class_name)
|
558
|
+
|
559
|
+
if assoc_class.column_names.include?("name")
|
549
560
|
display_column = "name"
|
550
|
-
elsif
|
561
|
+
elsif assoc_class.column_names.include?("to_label")
|
551
562
|
display_column = "to_label"
|
552
|
-
elsif
|
563
|
+
elsif assoc_class.column_names.include?("full_name")
|
553
564
|
display_column = "full_name"
|
554
|
-
elsif
|
565
|
+
elsif assoc_class.column_names.include?("display_name")
|
555
566
|
display_column = "display_name"
|
556
|
-
elsif
|
567
|
+
elsif assoc_class.column_names.include?("email")
|
557
568
|
display_column = "email"
|
558
569
|
else
|
559
|
-
puts "
|
570
|
+
puts "*** Oops: Can't find any column to use as the display label for the #{assoc.name.to_s} association on the #{singular_class} model . TODO: Please implement just one of: 1) name, 2) to_label, 3) full_name, 4) display_name, or 5) email directly on your #{assoc.class_name} model (either as database field or model methods), then RERUN THIS GENERATOR. (If more than one is implemented, the field to use will be chosen based on the rank here, e.g., if name is present it will be used; if not, I will look for a to_label, etc)"
|
560
571
|
end
|
561
572
|
|
562
573
|
" %td
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: common_core_js
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jason Fleetwood-Boldt
|
@@ -193,12 +193,11 @@ files:
|
|
193
193
|
- lib/tasks/common_core_js_tasks.rake
|
194
194
|
homepage: https://blog.jasonfleetwoodboldt.com/common-core-js/
|
195
195
|
licenses:
|
196
|
-
-
|
196
|
+
- Commit to Social Justice
|
197
197
|
metadata:
|
198
198
|
source_code_uri: https://github.com/jasonfb/common_core_js
|
199
|
-
documentation_uri: https://
|
199
|
+
documentation_uri: https://jfb.teachable.com/p/gems-by-jason
|
200
200
|
homepage_uri: https://blog.jasonfleetwoodboldt.com/common-core-js/
|
201
|
-
mailing_list_uri: https://blog.jasonfleetwoodboldt.com/#sfba-form2-container
|
202
201
|
post_install_message: |
|
203
202
|
---------------------------------------------
|
204
203
|
Welcome to Common Core
|