schemable 0.1.0 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/generators/schemable/model_generator.rb +2 -4
- data/lib/schemable/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ff54bf6e14c37d3fdc76b31bd73073334d753539e3dea0e0deecf63268863633
|
4
|
+
data.tar.gz: debcf929b72f6ac7afdcc4906aeb80407a0b5aa9dfdde86f401dfb17099af0b7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d159f7c5489bf55387f20d8552d6f6c393396a9692798de7f74e34b73a1a9ae645fdffd82fc66f8264a1ab385da0136d4ab663e5952e6e3bc0f89a2b255addcb
|
7
|
+
data.tar.gz: c509ac7d2711b2ff22b15fed2430fe4f434ddd3b842fca01c6a42f263e0b9027f950a302b410b348ac369c4bf35549f3e178c2596d687562269fdc86df2dd7cd
|
@@ -12,15 +12,13 @@ module Schemable
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def copy_initializer
|
15
|
-
target_path = "lib/swagger/definitions/#{@model_name.underscore.downcase.
|
15
|
+
target_path = "lib/swagger/definitions/#{@model_name.underscore.downcase.singularize}.rb"
|
16
16
|
|
17
17
|
if Rails.root.join(target_path).exist?
|
18
18
|
say_status('skipped', 'Model definition already exists')
|
19
19
|
else
|
20
20
|
|
21
21
|
create_file(target_path, <<-FILE
|
22
|
-
require './lib/swagger/concerns/schemable'
|
23
|
-
|
24
22
|
module Swagger
|
25
23
|
module Definitions
|
26
24
|
class #{@model_name.classify}
|
@@ -31,7 +29,7 @@ module Swagger
|
|
31
29
|
attr_accessor :instance
|
32
30
|
|
33
31
|
def initialize
|
34
|
-
@instance ||= JSONAPI::Serializable::Renderer.new.render(FactoryBot.create(:#{@model_name.underscore.downcase.
|
32
|
+
@instance ||= JSONAPI::Serializable::Renderer.new.render(FactoryBot.create(:#{@model_name.underscore.downcase.singularize}), class: serializers_map, include: [])
|
35
33
|
end
|
36
34
|
|
37
35
|
def serializer
|
data/lib/schemable/version.rb
CHANGED