ntq_tools 0.4.3 → 0.4.6

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: 6a659efedee45f286353f74dfd011457c90e4b3eaf8c32c4d0cb383cce2ccc7d
4
- data.tar.gz: 821a0eac4a4087c84d8ba19fed374e6c3b0356293b0b13d603cc81da4b6fc55d
3
+ metadata.gz: 7c27346acfab847af2923c27896c8b660fa606417f253685e53623e341a4ffdd
4
+ data.tar.gz: 80b98435b7ce0af962ce9822481171f2287863351f4b0c2d8f9b5bcd889854c5
5
5
  SHA512:
6
- metadata.gz: 6b6ef7eccb919303e48b2c8585bc58aeeeec748cf911fbb0658d399dd9d37ced2bcdbe081c7ca8d91e47a3b7d751c1b419e6771ab26aaf2d975e3b38dd81f48c
7
- data.tar.gz: f4f9ea8b791b601ee3e324228a1e2129f0cc823aa810e4918fdb9f2eab434ebe6b2f65cb863be187792a55b55fc98c505d0b3b358f8609d8a46bc6b70e2342f8
6
+ metadata.gz: 0d173324ffd44ed642f1132ddc3906e3f0c2b11da57a7da0a27164601010687a1fe70520a2ecae12350fe14ab5de97e93188cc9422556f1a69ac396c8dc618d0
7
+ data.tar.gz: dc4ea7bf49393e3cb7880016724c9ce5dfe16b92e8ce90b2ebe25ae7d82d6519d0bbb3c4527fc233b54a5a907cb8ec96fb2e0a6ce18a9e8b5ce312bb60e30e78
@@ -1,7 +1,7 @@
1
1
  require 'ntq_tools/translations/translation_tool'
2
2
  module NtqTools
3
3
  class TranslationsController < NtqTools::ApplicationController
4
- skip_before_action :verify_authenticity_token
4
+ skip_before_action :verify_authenticity_token, raise: false
5
5
  before_action :check_presence_of_key, except: [:refresh]
6
6
 
7
7
  def show
@@ -27,7 +27,7 @@ module NtqTools
27
27
  definition << "field :#{k}, Boolean"
28
28
  when :decimal
29
29
  definition << "field :#{k}, Float"
30
- when :date, :datetime
30
+ when :date, :datetime, :time
31
31
  definition << "field :#{k}, Types::TimeType"
32
32
  else
33
33
  raise "Type non défini: #{v.type.inspect}"
@@ -80,6 +80,10 @@ module Types
80
80
  module #{plural_name.camelcase}
81
81
  class #{singular_name.camelcase}Type < BaseObject
82
82
  include Resolvers::TimestampsFields
83
+ include Resolvers::AuthorizationFields
84
+
85
+ # authorize_resource
86
+ # authorize_attributes
83
87
 
84
88
  #{definition.join('
85
89
  ')}
@@ -233,7 +237,7 @@ FILE
233
237
  FILE
234
238
 
235
239
  if defined?(Interactor)
236
- create_file "app/interactors/#{plural_name}/search_#{singular_name}.rb", <<-FILE
240
+ create_file "app/interactors/#{plural_name}/search_#{plural_name}.rb", <<-FILE
237
241
  module #{context_name}
238
242
  class Search#{class_name}
239
243
  include Interactor::Organizer
@@ -243,7 +247,7 @@ module #{context_name}
243
247
  end
244
248
  FILE
245
249
 
246
- create_file "app/interactors/#{plural_name}/get_#{singular_name}.rb", <<-FILE
250
+ create_file "app/interactors/#{plural_name}/get_#{plural_name}.rb", <<-FILE
247
251
  module #{context_name}
248
252
  class Get#{class_name}
249
253
  include Interactor
@@ -279,7 +283,9 @@ end
279
283
  argument :id, ID, required: true
280
284
  end
281
285
  def #{singular_name}(id:)
282
- ::#{singular_name.camelcase}.find(id)
286
+ record = ::#{singular_name.camelcase}.find(id)
287
+ context[:current_user].authorize!(:show, record) if context[:current_user]
288
+ record
283
289
  end\n
284
290
  FILE
285
291
  end
@@ -1,3 +1,3 @@
1
1
  module NtqTools
2
- VERSION = "0.4.3"
2
+ VERSION = "0.4.6"
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.4.3
4
+ version: 0.4.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-03-03 00:00:00.000000000 Z
11
+ date: 2023-06-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails