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: cbeb5958ef479f90d380f74d13512a988936a16636845f8873360a3160412b31
4
- data.tar.gz: a36e413a12bab5fcd370c60e059bf6767c42fdf16ffcddbed73356e829a0145a
3
+ metadata.gz: c5c6201f78773fe0427ef8b4329405e9eb2d8fef626ef26cd5800a123560856c
4
+ data.tar.gz: c63e87a37de15a6f5165713e4aef872cf8e7891e033b52e277c8cbfe04e9aed9
5
5
  SHA512:
6
- metadata.gz: e3e4cfedca1eeaa752ca79fdac1d6c577d88cdcc7cf20b247bd843265c66f4409424dd7921d2000f9939e0ba6433c31d9c06413c980b5515f01aa18376b80e63
7
- data.tar.gz: e4b558b3b6869bedc70c052af4ead39a5e5d06ca334ab18f46df0a22321076b691e85bcf8c7157b52241f7eecd936eed589a0dd1e2ad232d202b3f823a0c37b6
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/#{singular_name}/#{singular_name}_list_payload.rb", <<~FILE
209
+ create_file "app/graphql/types/#{plural_name}/#{singular_name}_list_payload.rb", <<~FILE
208
210
  module Types
209
- module #{singular_name.camelcase}
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
@@ -60,8 +60,6 @@ module NtqTools
60
60
  end
61
61
 
62
62
  def self.modify(key, values)
63
- puts key
64
- puts values.inspect
65
63
  config_folder = "#{::Rails.root}/config/locales/*.yml"
66
64
  file_pathnames = Dir[config_folder]
67
65
  return unless file_pathnames && file_pathnames.size > 0
@@ -1,3 +1,3 @@
1
1
  module NtqTools
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
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.0
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-24 00:00:00.000000000 Z
11
+ date: 2023-02-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails