souls 0.65.4 → 0.65.5
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: 2189748c3d80909f1e0281373e2016c8b6d0ee25a40b0db9f3d7d487d2fc7d11
|
4
|
+
data.tar.gz: 1ef32917dd90e7a9b41c65e9d1c176a131f786a118757f66202e7990c571f1b9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 587fdae00e9252f6862712b4da67bc3bbfd848b928caaa28a2508cf3c08a0e3d7214762487718263675831e5f331624a757eadd5489765bb0e222c13fcf77974
|
7
|
+
data.tar.gz: 15407243da04231cd9841287f774a005029067fd5c4a364aa17f297a10e3dd373e713a6cfc3d71130aa7e351a09ba807af7b1ffb419a3f594f926721f2f5a304
|
@@ -45,7 +45,7 @@ module Souls
|
|
45
45
|
type = Souls.type_check(param[:type])
|
46
46
|
type = "[#{type}]" if param[:array]
|
47
47
|
type = "String" if param[:column_name].match?(/$*_id\z/)
|
48
|
-
next if
|
48
|
+
next if param[:column_name] == "user_id"
|
49
49
|
|
50
50
|
if i == params[:params].size - 1
|
51
51
|
f.write(" argument :#{param[:column_name]}, #{type}, required: false\n\n")
|
@@ -121,6 +121,7 @@ module Souls
|
|
121
121
|
if i == params[:params].size - 1
|
122
122
|
f.write(" argument :#{param[:column_name]}, #{type}, required: false\n\n")
|
123
123
|
f.write(" def resolve(args)\n")
|
124
|
+
f.write(" _, data_id = SoulsApiSchema.from_global_id(args[:id])\n")
|
124
125
|
else
|
125
126
|
f.write(" argument :#{param[:column_name]}, #{type}, required: false\n")
|
126
127
|
end
|
@@ -140,12 +141,11 @@ module Souls
|
|
140
141
|
", #{n[:column_name]}: #{n[:column_name]}"
|
141
142
|
end
|
142
143
|
f.write(" new_record = { **args #{relation_params.compact.join} }\n")
|
143
|
-
f.write(" data = ::#{singularized_class_name.camelize}.find(article_id)\n")
|
144
|
-
f.write(" data.update(new_record)\n")
|
145
144
|
else
|
146
|
-
f.write("
|
147
|
-
f.write(" data.update(args)\n")
|
145
|
+
f.write(" new_record = args.except(:id)\n")
|
148
146
|
end
|
147
|
+
f.write(" data = ::#{singularized_class_name.camelize}.find(data_id)\n")
|
148
|
+
f.write(" data.update(new_record)\n")
|
149
149
|
end
|
150
150
|
File.open(file_path, "a") do |new_line|
|
151
151
|
new_line.write(<<~TEXT)
|
@@ -61,7 +61,11 @@ module Souls
|
|
61
61
|
rbs_type = Souls.rbs_type_check(param[:type])
|
62
62
|
type = "[#{type}]" if param[:array]
|
63
63
|
if i.zero?
|
64
|
-
|
64
|
+
if param[:column_name].match?(/$*_id\z/)
|
65
|
+
f.write(" def self.argument: (:#{param[:column_name]}, String, required: false ) -> #{rbs_type}\n")
|
66
|
+
else
|
67
|
+
f.write(" def self.argument: (:#{param[:column_name]}, #{type}, required: false ) -> #{rbs_type}\n")
|
68
|
+
end
|
65
69
|
elsif param[:column_name].match?(/$*_id\z/)
|
66
70
|
f.write(" | (:#{param[:column_name]}, String, required: false ) -> String\n")
|
67
71
|
else
|
@@ -117,6 +121,8 @@ module Souls
|
|
117
121
|
params[:params].each_with_index do |param, i|
|
118
122
|
type = Souls.rbs_type_check(param[:type])
|
119
123
|
type = "[#{type}]" if param[:array]
|
124
|
+
next if param[:column_name] == "user_id"
|
125
|
+
|
120
126
|
if i == params[:params].size - 1
|
121
127
|
f.write(" #{param[:column_name]}: #{type}?\n")
|
122
128
|
else
|
@@ -135,9 +141,16 @@ module Souls
|
|
135
141
|
type = Souls.type_check(param[:type])
|
136
142
|
rbs_type = Souls.rbs_type_check(param[:type])
|
137
143
|
type = "[#{type}]" if param[:array]
|
144
|
+
next if param[:column_name] == "user_id"
|
145
|
+
|
138
146
|
required = param[:column_name] == "id" ? "required: true" : "required: false"
|
139
147
|
if i.zero?
|
140
|
-
|
148
|
+
if param[:column_name].match?(/$*_id\z/)
|
149
|
+
f.write(" def self.argument: (:#{param[:column_name]}, String, #{required} ) -> String\n")
|
150
|
+
else
|
151
|
+
f.write(" def self.argument: (:#{param[:column_name]}, #{type}, #{required} ) -> #{rbs_type}\n")
|
152
|
+
end
|
153
|
+
|
141
154
|
else
|
142
155
|
f.write(" | (:#{param[:column_name]}, #{type}, #{required} ) -> #{rbs_type}\n")
|
143
156
|
end
|
data/lib/souls/version.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.44.
|
1
|
+
0.44.5
|
@@ -1 +1 @@
|
|
1
|
-
0.44.
|
1
|
+
0.44.5
|