worker_plugins 0.0.9 → 0.0.10
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a100e9889c3079f041cc886244ec356192af2f4463be274981149d7343b60883
|
|
4
|
+
data.tar.gz: 38f45e3ec7bfd644156db849907c723bd138595bc5ee8c97de60953a908df0c4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e5ccaad363855757ddbb62704900ed90ca0c33d5217633f82423b1d6f6c34ce2ae93a5ca302b38751c628121a2afe2aafa82fccb2be568930df806b40a4c4f47
|
|
7
|
+
data.tar.gz: 425085627b54a01e29865258303a836dba930f81af0f564157e4d08c83e76ec2c122bf6b3973fd08f06ee57b50ddd64c56c006c72adaab19dd3da7f5e7d51afa
|
|
@@ -4,14 +4,12 @@ class WorkerPlugins::SelectColumnWithTypeCast < WorkerPlugins::ApplicationServic
|
|
|
4
4
|
def perform
|
|
5
5
|
return succeed! query.select(column_name_to_select) if same_type?
|
|
6
6
|
|
|
7
|
-
if column_to_compare_with.type == :
|
|
8
|
-
succeed! query_with_varchar
|
|
9
|
-
elsif column_to_compare_with.type == :integer
|
|
7
|
+
if column_to_compare_with.type == :integer
|
|
10
8
|
succeed! query_with_integer
|
|
9
|
+
elsif column_to_compare_with.type == :uuid
|
|
10
|
+
succeed! query_with_uuid
|
|
11
11
|
else
|
|
12
|
-
|
|
13
|
-
"#{model_class.table_name}.#{column_name_to_select} (#{column_to_select.type}) " \
|
|
14
|
-
"#{column_to_compare_with.name} (#{column_to_compare_with.type})"
|
|
12
|
+
succeed! query_with_varchar
|
|
15
13
|
end
|
|
16
14
|
end
|
|
17
15
|
|
|
@@ -31,6 +29,10 @@ class WorkerPlugins::SelectColumnWithTypeCast < WorkerPlugins::ApplicationServic
|
|
|
31
29
|
query.select("CAST(#{model_class.table_name}.#{column_name_to_select} AS VARCHAR)")
|
|
32
30
|
end
|
|
33
31
|
|
|
32
|
+
def query_with_uuid
|
|
33
|
+
query.select("CAST(#{model_class.table_name}.#{column_name_to_select} AS UUID)")
|
|
34
|
+
end
|
|
35
|
+
|
|
34
36
|
def same_type?
|
|
35
37
|
column_to_select.type == column_to_compare_with.type
|
|
36
38
|
end
|