ntq_tools 0.3.0 → 0.3.1
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: c5c6201f78773fe0427ef8b4329405e9eb2d8fef626ef26cd5800a123560856c
|
4
|
+
data.tar.gz: c63e87a37de15a6f5165713e4aef872cf8e7891e033b52e277c8cbfe04e9aed9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0ed2ae3fc896d028160cd65f652ceebe398b97ab874ae910d80c2935bec88dbd1fe2529519585e1003bed8b6e0f4614027c205b6602b02b46f037efda9a9c074
|
7
|
+
data.tar.gz: 7aaa088106b37e07cbd5cb600f968485ca6dc1d6ba97563e22bf878a7551c37e66713b97e2771288399b05243d76b31deb58e2d52b25179ab183fb627150bc35
|
@@ -115,11 +115,12 @@ FILE
|
|
115
115
|
module Mutations
|
116
116
|
class #{plural_name.camelcase}::Create#{singular_name.camelcase} < BaseMutation
|
117
117
|
field :flash_messages, [Types::JsonType], null: false
|
118
|
+
field :#{singular_name}, Types::#{singular_name.camelcase}Type, null: false
|
118
119
|
|
119
120
|
argument :attributes, InputObject::#{singular_name.camelcase}Attributes, required: true
|
120
121
|
|
121
122
|
def authorized?(attributes:)
|
122
|
-
context[:current_user].can?(:create, #{singular_name})
|
123
|
+
context[:current_user].can?(:create, #{singular_name.camelcase})
|
123
124
|
end
|
124
125
|
|
125
126
|
def resolve(attributes:)
|
@@ -145,6 +146,7 @@ FILE
|
|
145
146
|
module Mutations
|
146
147
|
class #{plural_name.camelcase}::Update#{singular_name.camelcase} < BaseMutation
|
147
148
|
field :flash_messages, [Types::JsonType], null: false
|
149
|
+
field :#{singular_name}, Types::#{singular_name.camelcase}Type, null: false
|
148
150
|
|
149
151
|
argument :id, ID, required: true
|
150
152
|
argument :attributes, InputObject::#{singular_name.camelcase}Attributes, required: true
|
@@ -159,8 +161,8 @@ FILE
|
|
159
161
|
#{singular_name}.attributes = attributes
|
160
162
|
#{singular_name}.save!
|
161
163
|
{
|
164
|
+
#{singular_name}: #{singular_name},
|
162
165
|
flash_messages: [
|
163
|
-
#{singular_name}: #{singular_name},
|
164
166
|
{
|
165
167
|
type: 'success',
|
166
168
|
message: I18n.t(:'flashes.#{plural_name}.update.success')
|
@@ -204,9 +206,9 @@ FILE
|
|
204
206
|
puts 'Do you want to create the payload file ? (y/n)'
|
205
207
|
input = $stdin.gets.strip
|
206
208
|
if input == 'y'
|
207
|
-
create_file "app/graphql/types/#{
|
209
|
+
create_file "app/graphql/types/#{plural_name}/#{singular_name}_list_payload.rb", <<~FILE
|
208
210
|
module Types
|
209
|
-
module #{
|
211
|
+
module #{plural_name.camelcase}
|
210
212
|
class #{singular_name.camelcase}ListPayload < BaseObject
|
211
213
|
field :#{plural_name}, [#{singular_name.camelcase}::#{singular_name.camelcase}Type], null: true
|
212
214
|
field :pagination, PaginationType, null: true
|
data/lib/ntq_tools/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ntq_tools
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kevin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-02-
|
11
|
+
date: 2023-02-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|