worker_plugins 0.0.10 → 0.0.11
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: 60d562f95a7e106a56e44fc6a391390d09611fb54763f982f799e068eb35c635
|
|
4
|
+
data.tar.gz: c5092384cc830ad87f0c1173001507e1deb84011f923b1e4133ed418b75df5b5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ef290cb5584a36e590203d5e6b46ec8a6c2427170c028f5a0c7444319381d462de3aaf54d8226e02875c1951991c3b3b3e9d1fb7d82d800bbb5b1ac51b774d92
|
|
7
|
+
data.tar.gz: bc35ab922d0d328f9ea00fd90318936bf19c61363891c042743e3767f3a1b2af894d17f0067258e7bfbda933b3fc91997025a3397bd40724502f638b96d66d82
|
data/README.md
CHANGED
|
@@ -27,6 +27,24 @@ Optimally loop over resources on a workspace:
|
|
|
27
27
|
workspace.each_resource(types: ['User']) do |user|
|
|
28
28
|
```
|
|
29
29
|
|
|
30
|
+
## Release
|
|
31
|
+
|
|
32
|
+
Run the release task from a clean worktree:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
bundle exec rake release:patch
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
The task checks out `master`, fetches and fast-forwards from `origin/master`, bumps `lib/worker_plugins/version.rb`, commits and pushes the release commit, runs `npm login` if `npm whoami` shows no active session, then builds and pushes the gem to RubyGems and removes the generated `.gem` file afterward.
|
|
39
|
+
|
|
40
|
+
Use `BUMP=minor`, `BUMP=major`, or `VERSION=x.y.z` to control the version bump:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
bundle exec rake release:minor
|
|
44
|
+
bundle exec rake release:major
|
|
45
|
+
bundle exec rake release:rubygems VERSION=0.1.0
|
|
46
|
+
```
|
|
47
|
+
|
|
30
48
|
## License
|
|
31
49
|
|
|
32
50
|
This project rocks and uses MIT-LICENSE.
|
data/Rakefile
CHANGED
|
@@ -30,4 +30,10 @@ class WorkerPlugins::ApplicationService < ServicePattern::Service
|
|
|
30
30
|
def sqlite?
|
|
31
31
|
ActiveRecord::Base.connection.instance_values["config"][:adapter].downcase.include?("sqlite")
|
|
32
32
|
end
|
|
33
|
+
|
|
34
|
+
def mysql?
|
|
35
|
+
adapter_name = ActiveRecord::Base.connection.instance_values["config"][:adapter].downcase
|
|
36
|
+
|
|
37
|
+
adapter_name.include?("mysql") || adapter_name.include?("trilogy")
|
|
38
|
+
end
|
|
33
39
|
end
|
|
@@ -22,15 +22,27 @@ class WorkerPlugins::SelectColumnWithTypeCast < WorkerPlugins::ApplicationServic
|
|
|
22
22
|
end
|
|
23
23
|
|
|
24
24
|
def query_with_integer
|
|
25
|
-
|
|
25
|
+
if mysql?
|
|
26
|
+
query.select("CAST(#{model_class.table_name}.#{column_name_to_select} AS SIGNED)")
|
|
27
|
+
else
|
|
28
|
+
query.select("CAST(#{model_class.table_name}.#{column_name_to_select} AS BIGINT)")
|
|
29
|
+
end
|
|
26
30
|
end
|
|
27
31
|
|
|
28
32
|
def query_with_varchar
|
|
29
|
-
|
|
33
|
+
if mysql?
|
|
34
|
+
query.select("CAST(#{model_class.table_name}.#{column_name_to_select} AS CHAR)")
|
|
35
|
+
else
|
|
36
|
+
query.select("CAST(#{model_class.table_name}.#{column_name_to_select} AS VARCHAR)")
|
|
37
|
+
end
|
|
30
38
|
end
|
|
31
39
|
|
|
32
40
|
def query_with_uuid
|
|
33
|
-
|
|
41
|
+
if postgres?
|
|
42
|
+
query.select("CAST(#{model_class.table_name}.#{column_name_to_select} AS UUID)")
|
|
43
|
+
else
|
|
44
|
+
query_with_varchar
|
|
45
|
+
end
|
|
34
46
|
end
|
|
35
47
|
|
|
36
48
|
def same_type?
|