ntq_tools 0.4.4 → 0.4.7
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: a82614809d5e0fd47499b7cf0a64353e23f59c512a1035899978b59eb9e18013
|
4
|
+
data.tar.gz: 36d41ccd2dbaeed6257036f046a92d47bd9420a5be01829f52667b46ec802dde
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 382f14dd86d57805747dc87b090f289ef6d85e3dc129c45550985e8fb07b0cff4cbe726bd26a3942eebf807bcf8838f0997977a183d44fa0fc87865f86da8cd4
|
7
|
+
data.tar.gz: 590f5d6b2a1a8dd8d4c70c2006333090599775ecce8bb1fcf2a685cb51a152108f9977751e9a367edca2e27834ef369c49f02bd0fcebd715ccfb202fc958e6c0
|
@@ -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_#{
|
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_#{
|
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
|
@@ -63,14 +63,14 @@ module NtqTools
|
|
63
63
|
config_folder = "#{::Rails.root}/config/locales/*.yml"
|
64
64
|
file_pathnames = Dir[config_folder]
|
65
65
|
return unless file_pathnames && file_pathnames.size > 0
|
66
|
-
|
67
|
-
load_files(file_pathnames)
|
68
|
-
|
66
|
+
|
67
|
+
load_files(file_pathnames)
|
68
|
+
|
69
69
|
available_locales = I18n.available_locales.map(&:to_s)
|
70
70
|
|
71
71
|
default_scope = search_key_for_locale(I18n.default_locale, key)&.filename
|
72
72
|
default_scope = "" unless default_scope
|
73
|
-
|
73
|
+
|
74
74
|
values.each do |locale, v|
|
75
75
|
next unless available_locales.include?(locale.to_s) || v.blank?
|
76
76
|
|
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.4.
|
4
|
+
version: 0.4.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kevin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-07-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|