bullet_train-super_scaffolding 1.2.11 → 1.2.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bullet_train/super_scaffolding/version.rb +1 -1
- data/lib/scaffolding/transformer.rb +15 -2
- data/lib/scaffolding.rb +1 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a298ab4bf4e4ef34b72728d13025076979ce8a53ed014b12c88103922b724b42
|
4
|
+
data.tar.gz: 673d9792c5134c97faff3625581e39d2250a703ccfab7b21ad28d004f0790350
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 26045ef5529ee5792c835ad924bb029782d13338ddfc1b2f40f350595e7d9099a0dca2a5f21f62944eda315c236a73ffda53bf1f67d13f8fbc1b80f23f4f50ba
|
7
|
+
data.tar.gz: b9c3c2e11675220b19e0104fcfc5345dad1f21f6efb3affd90247b335a04d17995b1d4cf8ee0ef6b5ba76e79ec3a088a372c50e910607ae98bbbd69786194eb3
|
@@ -498,9 +498,20 @@ class Scaffolding::Transformer
|
|
498
498
|
def add_ability_line_to_roles_yml(class_names = nil)
|
499
499
|
model_names = class_names || [child]
|
500
500
|
role_file = "./config/models/roles.yml"
|
501
|
+
roles_hash = YAML.load_file(role_file)
|
502
|
+
default_role_placements = [
|
503
|
+
[:default, :models],
|
504
|
+
[:admin, :models]
|
505
|
+
]
|
506
|
+
|
501
507
|
model_names.each do |model_name|
|
502
|
-
|
503
|
-
|
508
|
+
default_role_placements.each do |role_placement|
|
509
|
+
stringified_role_placement = role_placement.map { |placement| placement.to_s }
|
510
|
+
if roles_hash.dig(*stringified_role_placement)[model_name].nil?
|
511
|
+
role_type = (role_placement.first == :admin) ? "manage" : "read"
|
512
|
+
Scaffolding::FileManipulator.add_line_to_yml_file(role_file, "#{model_name}: #{role_type}", role_placement)
|
513
|
+
end
|
514
|
+
end
|
504
515
|
end
|
505
516
|
end
|
506
517
|
|
@@ -711,6 +722,8 @@ class Scaffolding::Transformer
|
|
711
722
|
"text"
|
712
723
|
when "text_area"
|
713
724
|
"text"
|
725
|
+
when "number_field"
|
726
|
+
"number"
|
714
727
|
when "file_field"
|
715
728
|
"file"
|
716
729
|
when "password_field"
|
data/lib/scaffolding.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bullet_train-super_scaffolding
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Culver
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-03-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: standard
|