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: 18212ce104518b32a3b4b252161d47c91501e599a7982a704b573fa6745bab24
4
- data.tar.gz: aa0a3d7c1ddd955e586dd4248f010c3465a00176e37d0c5a7d38d94e2f624480
3
+ metadata.gz: b8ea73f9ae8761072733f737b76e27e785e32a955380e0ebe4c734e845a98044
4
+ data.tar.gz: 007fb499bae3ee21f29435ef492daef2e429a44914f5e438232aae4fc60e4a8b
5
5
  SHA512:
6
- metadata.gz: ff92cd603d95135cddce3443c0e9a0c0dd0554656aed89586b8d0c56201f9bcb2b3f1d621149524e293b01290006eac81696f8abd9cf15d537a268e509cd93c9
7
- data.tar.gz: be967475a4cf3768f9d106824ce624a4a8132bdc01bf81b1ff35e2e6842ee1801da42d5c9e17b9df796ab216a6c5324482d3e257103b926f113f91ef31d3ce90
6
+ metadata.gz: f752009ed927514fcea94d4a45c8ad3e894d2f6afe89f473ed5df7dce7e43eb5289ebb5abaac08d2e63f14dbd8c1c69fdf43fdd576678fc5b100b1a7f7798c2a
7
+ data.tar.gz: 194aeba80d5c89ce5e32baad5d56dcfd4d6ca5c2b326c57e4bd95c7a0172de6993512e18661a5dc61c859768c10caa94d3486a6ac2e080b22be04a16155306eb
data/README.md CHANGED
@@ -1,4 +1,5 @@
1
1
  # API Scaffolding
2
+ [![Gem Version](https://badge.fury.io/rb/api_scaffolding.svg)](https://badge.fury.io/rb/api_scaffolding)
2
3
 
3
4
  Генерация контроллеров API и модулей с параметрами Grape и Grape Entity.
4
5
 
@@ -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 < BaseEntities::List
5
+ class List < <%= ApiScaffolding.config.entity_list_parent_class %>
6
6
  <%= list_fields %>
7
7
  end
8
8
 
9
9
  # запись
10
- class Entry < BaseEntities::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.2
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-07 00:00:00.000000000 Z
11
+ date: 2024-05-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails