Skip to content

Commit ca5a2e8

Browse files
Merge pull request #734 from code0-tech/733-fix-wrong-data-type-rule-variant-name
Fix DataTypeRule naming
2 parents 890ecfd + 32956dc commit ca5a2e8

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

app/graphql/types/data_type_rules/variant_enum.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ class VariantEnum < Types::BaseEnum
1515
value: :item_of_collection
1616
value :REGEX, 'The rule checks if a string matches a specified regular expression.',
1717
value: :regex
18-
value :INPUT_TYPE, 'The rule checks if the data type matches a specific input type.',
19-
value: :input_type
18+
value :INPUT_TYPES, 'The rule checks if the data type matches a specific input type.',
19+
value: :input_types
2020
value :RETURN_TYPE, 'The rule checks if the data type matches a specific return type.',
2121
value: :return_type
2222
value :PARENT_TYPE, 'The rule checks if the data type is a child of a specific parent type.',

app/models/data_type_rule.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class DataTypeRule < ApplicationRecord
88
number_range: 4,
99
regex: 5,
1010
return_type: 6,
11-
input_type: 7,
11+
input_types: 7,
1212
parent_type: 8,
1313
}.with_indifferent_access
1414

@@ -57,9 +57,9 @@ class DataTypeRule < ApplicationRecord
5757
hash_conversion: true,
5858
}
5959

60-
validates :config, if: :variant_input_type?,
60+
validates :config, if: :variant_input_types?,
6161
'sagittarius/validators/json_schema': {
62-
filename: 'data_types/InputTypeRuleConfig',
62+
filename: 'data_types/InputTypesRuleConfig',
6363
hash_conversion: true,
6464
}
6565
end

app/models/json_schemas/data_types/InputTypeRuleConfig.json renamed to app/models/json_schemas/data_types/InputTypesRuleConfig.json

File renamed without changes.

docs/graphql/enum/datatyperulesvariant.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ The type of rule that can be applied to a data type.
88
|-------|-------------|
99
| `CONTAINS_KEY` | The rule checks if a key is present in the data type. |
1010
| `CONTAINS_TYPE` | The rule checks if a specific type is present in the data type. |
11-
| `INPUT_TYPE` | The rule checks if the data type matches a specific input type. |
11+
| `INPUT_TYPES` | The rule checks if the data type matches a specific input type. |
1212
| `ITEM_OF_COLLECTION` | The rule checks if an item is part of a collection in the data type. |
1313
| `NUMBER_RANGE` | The rule checks if a number falls within a specified range. |
1414
| `PARENT_TYPE` | The rule checks if the data type is a child of a specific parent type. |

0 commit comments

Comments
 (0)