bullet_train-super_scaffolding 1.2.11 → 1.2.13
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: 2b891afd2ffdfb5c960dc409911d2fce58515ffc2b4a86ca25f848cbb9550489
|
4
|
+
data.tar.gz: 39250a644ffabfa4c0095a3cf8276e13822edb5f827a4cfa2ed55ca6a57a5493
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dd0c77206a5ff177586b7dc43a158b632e4156e615fca4e5768733c23b8ae0556165c1257421dbb14df91657f95e46feaa55e1c63c62ea31546b02dc7463be6f
|
7
|
+
data.tar.gz: c4e23f16581652f1808068b87e28be3affd35aad6f81d1724eaa950b55a845f44266d625557da7972aae0a45ea9550ca7689625339986d186ce644711fd35b84
|
@@ -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.13
|
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-02
|
11
|
+
date: 2023-03-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: standard
|