api_scaffolding 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b8ea73f9ae8761072733f737b76e27e785e32a955380e0ebe4c734e845a98044
|
4
|
+
data.tar.gz: 007fb499bae3ee21f29435ef492daef2e429a44914f5e438232aae4fc60e4a8b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f752009ed927514fcea94d4a45c8ad3e894d2f6afe89f473ed5df7dce7e43eb5289ebb5abaac08d2e63f14dbd8c1c69fdf43fdd576678fc5b100b1a7f7798c2a
|
7
|
+
data.tar.gz: 194aeba80d5c89ce5e32baad5d56dcfd4d6ca5c2b326c57e4bd95c7a0172de6993512e18661a5dc61c859768c10caa94d3486a6ac2e080b22be04a16155306eb
|
data/README.md
CHANGED
@@ -7,7 +7,9 @@ module ApiScaffolding
|
|
7
7
|
:params_fields_exclusions,
|
8
8
|
:entity_fields_exclusions,
|
9
9
|
:abilities_check,
|
10
|
-
:abilities_authorize_opts
|
10
|
+
:abilities_authorize_opts,
|
11
|
+
:entity_list_parent_class,
|
12
|
+
:entity_entry_parent_class
|
11
13
|
|
12
14
|
def default_api_version
|
13
15
|
@default_api_version || ''
|
@@ -36,6 +38,14 @@ module ApiScaffolding
|
|
36
38
|
def abilities_authorize_opts
|
37
39
|
@abilities_authorize_opts || ''
|
38
40
|
end
|
41
|
+
|
42
|
+
def entity_list_parent_class
|
43
|
+
@entity_list_parent_class || 'Grape::Entity'
|
44
|
+
end
|
45
|
+
|
46
|
+
def entity_entry_parent_class
|
47
|
+
@entity_entry_parent_class || 'Grape::Entity'
|
48
|
+
end
|
39
49
|
end
|
40
50
|
|
41
51
|
def self.configure
|
@@ -32,6 +32,11 @@ if defined?(ApiScaffold)
|
|
32
32
|
# deleted_at
|
33
33
|
# ]
|
34
34
|
|
35
|
+
# классы наследования Grape Entity (по умолчанию - Grape::Entity)
|
36
|
+
#
|
37
|
+
# config.entity_list_parent_class = ''
|
38
|
+
# config.entity_entry_parent_class = ''
|
39
|
+
|
35
40
|
# список исключений, для которых не будут добавляться поля в классе entity
|
36
41
|
#
|
37
42
|
# config.entity_fields_exclusions = %w[]
|
@@ -2,12 +2,12 @@
|
|
2
2
|
class <%= entity_class_name %>
|
3
3
|
|
4
4
|
# список
|
5
|
-
class List <
|
5
|
+
class List < <%= ApiScaffolding.config.entity_list_parent_class %>
|
6
6
|
<%= list_fields %>
|
7
7
|
end
|
8
8
|
|
9
9
|
# запись
|
10
|
-
class Entry <
|
10
|
+
class Entry < <%= ApiScaffolding.config.entity_entry_parent_class %>
|
11
11
|
<%= entry_fields %>
|
12
12
|
end
|
13
13
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: api_scaffolding
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Павел Бабин
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-05-
|
11
|
+
date: 2024-05-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|