bullet_train 1.0.63 → 1.0.66
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/concerns/controllers/base.rb +1 -0
- data/app/helpers/concerns/helpers/base.rb +6 -0
- data/config/initializers/concerns/inflections_base.rb +6 -0
- data/docs/super-scaffolding.md +5 -0
- data/lib/bullet_train/resolver.rb +11 -2
- data/lib/bullet_train/version.rb +1 -1
- metadata +18 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2114d834c08753f7e5317dece75280a4ca1c0219b35e82ca288a9c57f8b509fe
|
4
|
+
data.tar.gz: 606fb25877ff23bdc053f588a3b7c5a1a43fadc3dba67c9fe72d1acac1d0c4bf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: da748a3a957199b09a8fcb11d3b1c9928f320079debdbc86cc698729eadfc9f1657a6e119e21a98391f0e843b5a1543c08315f7393bd47567e39199a707d0937
|
7
|
+
data.tar.gz: '05159ec9e61da9235879067c91c0351e6e3755ad9d3a4ff5830ea39d112c99433a372f82d0711c3b7da58139b4678a33509902c6b08892f2f5739a11fe033464'
|
@@ -0,0 +1,6 @@
|
|
1
|
+
ActiveSupport::Inflector.inflections(:en) do |inflect|
|
2
|
+
# "_by" is a particularly common suffix for associations in Bullet Train applications (e.g. `created_by`, etc.)
|
3
|
+
# but it gets pluralized incorrectly as "_bies". This should fix both Super Scaffolding for those fields and
|
4
|
+
# the resulting invocations of the scope validator that are generated by Super Scaffolding.
|
5
|
+
inflect.irregular "by", "bys"
|
6
|
+
end
|
data/docs/super-scaffolding.md
CHANGED
@@ -108,6 +108,11 @@ rake db:migrate
|
|
108
108
|
|
109
109
|
As you can see, when we're using `crud-field`, we don't need to supply the chain of ownership back to `Team`.
|
110
110
|
|
111
|
+
If you want to scaffold a new field to use for read-only purposes, add the following option to omit the field from the form and all other files that apply:
|
112
|
+
```
|
113
|
+
bin/super-scaffold crud-field Project description:trix_editor{readonly}
|
114
|
+
```
|
115
|
+
|
111
116
|
### 4. Adding Option Fields with Fixed, Translatable Options
|
112
117
|
|
113
118
|
Continuing with the earlier example, let's address the following new requirement:
|
@@ -92,7 +92,16 @@ module BulletTrain
|
|
92
92
|
result[:absolute_path] = class_path || partial_path || locale_path || file_path
|
93
93
|
|
94
94
|
if result[:absolute_path]
|
95
|
-
|
95
|
+
if result[:absolute_path].include?("devise")
|
96
|
+
# The annotated path for devise doesn't actually return an absolute path,
|
97
|
+
# so we have to do some extra steps to get the correct string.
|
98
|
+
relative_partial_path = result[:absolute_path]
|
99
|
+
# If it's a devise partial, it should be coming from bullet_train-base
|
100
|
+
base_path = "#{`bundle show bullet_train`.chomp}/" + relative_partial_path
|
101
|
+
result[:absolute_path] = base_path
|
102
|
+
else
|
103
|
+
base_path = "bullet_train" + result[:absolute_path].partition("/bullet_train").last
|
104
|
+
end
|
96
105
|
|
97
106
|
# Try to calculate which package the file is from, and what it's path is within that project.
|
98
107
|
["app", "config", "lib"].each do |directory|
|
@@ -127,7 +136,7 @@ module BulletTrain
|
|
127
136
|
|
128
137
|
def partial_path
|
129
138
|
annotated_path = ApplicationController.render(template: "bullet_train/partial_resolver", layout: nil, assigns: {needle: @needle}).lines[1].chomp
|
130
|
-
if annotated_path =~ /<!-- BEGIN (
|
139
|
+
if annotated_path =~ /<!-- BEGIN (\S*) -->/
|
131
140
|
$1
|
132
141
|
else
|
133
142
|
raise "It looks like `config.action_view.annotate_rendered_view_with_filenames` isn't enabled?"
|
data/lib/bullet_train/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bullet_train
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.66
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Culver
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-05-
|
11
|
+
date: 2022-05-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: standard
|
@@ -388,6 +388,20 @@ dependencies:
|
|
388
388
|
- - ">="
|
389
389
|
- !ruby/object:Gem::Version
|
390
390
|
version: '0'
|
391
|
+
- !ruby/object:Gem::Dependency
|
392
|
+
name: pagy
|
393
|
+
requirement: !ruby/object:Gem::Requirement
|
394
|
+
requirements:
|
395
|
+
- - ">="
|
396
|
+
- !ruby/object:Gem::Version
|
397
|
+
version: '0'
|
398
|
+
type: :runtime
|
399
|
+
prerelease: false
|
400
|
+
version_requirements: !ruby/object:Gem::Requirement
|
401
|
+
requirements:
|
402
|
+
- - ">="
|
403
|
+
- !ruby/object:Gem::Version
|
404
|
+
version: '0'
|
391
405
|
description: Bullet Train
|
392
406
|
email:
|
393
407
|
- andrew.culver@gmail.com
|
@@ -436,6 +450,7 @@ files:
|
|
436
450
|
- app/helpers/account/users_helper.rb
|
437
451
|
- app/helpers/attributes_helper.rb
|
438
452
|
- app/helpers/base_helper.rb
|
453
|
+
- app/helpers/concerns/helpers/base.rb
|
439
454
|
- app/helpers/email_helper.rb
|
440
455
|
- app/helpers/images_helper.rb
|
441
456
|
- app/helpers/invitation_only_helper.rb
|
@@ -524,6 +539,7 @@ files:
|
|
524
539
|
- app/views/public/home/docs.html.erb
|
525
540
|
- app/views/user_mailer/invited.html.erb
|
526
541
|
- app/views/user_mailer/welcome.html.erb
|
542
|
+
- config/initializers/concerns/inflections_base.rb
|
527
543
|
- config/locales/en/base.yml
|
528
544
|
- config/locales/en/devise.en.yml
|
529
545
|
- config/locales/en/doorkeeper.en.yml
|