souls 0.30.3 → 0.30.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4a726d34c53e9d5c3d6faced80c9969fb57583800dc0bb8d037df70cb7aa52a7
4
- data.tar.gz: 05bc438a0b75dea4dc910f249fad1b1580cdca60c2ce527d9da8fa408b69d602
3
+ metadata.gz: 756bdf615c6f15e853a4d6262b5b3746d5413df7a0326a83e5402b49970e9968
4
+ data.tar.gz: 193eb321bf1c071422470e708d2a7662589c4521f8345564766f457de04ed8c6
5
5
  SHA512:
6
- metadata.gz: d587c45bbbc5887bcc8cfb02647326e070dbca7fe1971399ffe91a858121667c92baf5d25947e5cbeb032a5731180c05836f15ba36ba95b0ee4dd222598fd892
7
- data.tar.gz: 1861aea9fceeba6a02d37ada11ef0e6b5b8a1e088d2bde2f76d322faeff2889e16bba81dd0eb094027cc4444b5a57bc173bd163dc1e0c50c2a5e708f392cafb6
6
+ metadata.gz: 859afb0501215e723f57ca61bc7ad2e0e8911853c2cac70f91bd410b31ac56f09a954320c3eafd52aaa1154a15cd0714517a7fdaa2e4c0d93fd0e13fa27c1252
7
+ data.tar.gz: 30de9af84c98f30ac8e51b504b8b0a38f3bbf3908e9f24ab2d29bfc5db846c17383ffab19acd2e5cdf607c309054afe516f7b27ceb5c90085adf4614fee8146a
@@ -74,6 +74,19 @@ module Souls
74
74
  }[type.to_sym]
75
75
  end
76
76
 
77
+ def self.get_type(type)
78
+ {
79
+ bigint: "Integer",
80
+ string: "String",
81
+ float: "Float",
82
+ text: "String",
83
+ datetime: "GraphQL::Types::ISO8601DateTime",
84
+ date: "GraphQL::Types::ISO8601DateTime",
85
+ boolean: "Boolean",
86
+ integer: "Integer"
87
+ }[type.to_sym]
88
+ end
89
+
77
90
  def self.get_test_type(type)
78
91
  {
79
92
  bigint: "rand(1..10)",
@@ -19,9 +19,10 @@ module Souls
19
19
  type = Souls::Api::Generate.type_check(col[:type])
20
20
  type = "[#{type}]" if col[:array]
21
21
  args = check_mutation_argument(class_name: class_name)
22
- unless args.include?(col[:column_name])
23
- new_line.write(" argument :#{col[:column_name]}, #{type}, required: false\n")
24
- end
22
+ next if args.include?(col[:column_name])
23
+ next if col[:column_name] == "created_at" || col[:column_name] == "updated_at"
24
+
25
+ new_line.write(" argument :#{col[:column_name]}, #{type}, required: false\n")
25
26
  end
26
27
  argument = true
27
28
  end
@@ -49,9 +50,10 @@ module Souls
49
50
  type = Souls::Api::Generate.type_check(col[:type])
50
51
  type = "[#{type}]" if col[:array]
51
52
  args = check_mutation_argument(class_name: class_name, action: "update")
52
- unless args.include?(col[:column_name])
53
- new_line.write(" argument :#{col[:column_name]}, #{type}, required: false\n")
54
- end
53
+ next if args.include?(col[:column_name])
54
+ next if col[:column_name] == "created_at" || col[:column_name] == "updated_at"
55
+
56
+ new_line.write(" argument :#{col[:column_name]}, #{type}, required: false\n")
55
57
  end
56
58
  argument = true
57
59
  end
@@ -16,7 +16,7 @@ module Souls
16
16
  next unless line.include?("field") && !argument
17
17
 
18
18
  new_cols.each do |col|
19
- type = Souls::Api::Generate.type_check(col[:type])
19
+ type = Souls::Api::Generate.get_type(col[:type])
20
20
  type = "[#{type}]" if col[:array]
21
21
  args = check_type_argument(class_name: class_name)
22
22
  unless args.include?(col[:column_name])
data/lib/souls/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Souls
2
- VERSION = "0.30.3".freeze
2
+ VERSION = "0.30.4".freeze
3
3
  public_constant :VERSION
4
4
  end
@@ -1 +1 @@
1
- 0.9.3
1
+ 0.9.4
@@ -1 +1 @@
1
- 0.9.3
1
+ 0.9.4
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: souls
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.30.3
4
+ version: 0.30.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - POPPIN-FUMI