subroutine 4.1.2 → 4.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.bundler-version +1 -0
- data/.github/dependabot.yml +3 -3
- data/.github/workflows/build.yml +9 -14
- data/.ruby-version +1 -1
- data/Appraisals +10 -0
- data/CHANGELOG.MD +6 -0
- data/Gemfile +1 -4
- data/gemfiles/rails_6.1.gemfile +1 -1
- data/gemfiles/rails_6.1.gemfile.lock +37 -41
- data/gemfiles/rails_7.0.gemfile +1 -1
- data/gemfiles/rails_7.0.gemfile.lock +36 -40
- data/gemfiles/rails_7.1.gemfile +9 -0
- data/gemfiles/rails_7.1.gemfile.lock +109 -0
- data/gemfiles/rails_7.2.gemfile +9 -0
- data/gemfiles/rails_7.2.gemfile.lock +113 -0
- data/lib/subroutine/type_caster.rb +7 -1
- data/lib/subroutine/version.rb +1 -1
- data/subroutine.gemspec +0 -1
- data/test/subroutine/association_test.rb +15 -0
- data/test/subroutine/type_caster_test.rb +7 -1
- metadata +11 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c4fef2991f9d46da2fdbe6447c7e128042e8f60d6696a562f29b38e7cab2755d
|
4
|
+
data.tar.gz: 4bd93645f7a6efbbaccfe2fd3c2049b0f6b4310cd959a9f75fc6c4d7a23d8e25
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cc3b421c2c645c7ca205efa89104d16805320c3a9407ad3aa34330545d62e6037f713998bb483da8bf59934b3e2b090e5add1254fe19f04f888457d4ac12aa38
|
7
|
+
data.tar.gz: ee0734400bd7df20adadbbed1e565419995dca36f66e4f7d65664dac5c9ffb0a03041dc658842e307d3520825464cae6019b0e29fa843d01641e99eb35fc3bb2
|
data/.bundler-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.5.22
|
data/.github/dependabot.yml
CHANGED
@@ -8,7 +8,7 @@ updates:
|
|
8
8
|
time: "09:00"
|
9
9
|
timezone: "America/New_York"
|
10
10
|
commit-message:
|
11
|
-
prefix: "[github-actions] "
|
11
|
+
prefix: "[github-actions] "
|
12
12
|
- package-ecosystem: "bundler"
|
13
13
|
directory: "/"
|
14
14
|
schedule:
|
@@ -19,6 +19,6 @@ updates:
|
|
19
19
|
open-pull-requests-limit: 20
|
20
20
|
insecure-external-code-execution: deny
|
21
21
|
allow:
|
22
|
-
- dependency-type: "all"
|
22
|
+
- dependency-type: "all"
|
23
23
|
commit-message:
|
24
|
-
prefix: "[bundler] "
|
24
|
+
prefix: "[bundler] "
|
data/.github/workflows/build.yml
CHANGED
@@ -2,31 +2,26 @@ name: build
|
|
2
2
|
on:
|
3
3
|
pull_request:
|
4
4
|
push:
|
5
|
-
|
6
|
-
|
5
|
+
branches:
|
6
|
+
- main
|
7
7
|
jobs:
|
8
8
|
build:
|
9
9
|
runs-on: ubuntu-latest
|
10
|
-
continue-on-error: ${{ matrix.experimental }}
|
11
10
|
strategy:
|
12
11
|
fail-fast: false
|
13
12
|
matrix:
|
14
|
-
ruby-version: [
|
15
|
-
experimental: [false]
|
16
|
-
include:
|
17
|
-
- ruby-version: 3.0
|
18
|
-
experimental: true
|
19
|
-
- ruby-version: 3.1
|
20
|
-
experimental: true
|
21
|
-
- ruby-version: 3.2
|
22
|
-
experimental: true
|
13
|
+
ruby-version: [3.0, 3.1, 3.2]
|
23
14
|
steps:
|
24
15
|
- uses: actions/checkout@v4
|
25
16
|
with:
|
26
|
-
show-progress:
|
17
|
+
show-progress: "false"
|
18
|
+
- name: get bundler version
|
19
|
+
run: echo "BUNDLER=$(cat .bundler-version)" >> $GITHUB_ENV
|
27
20
|
- uses: ruby/setup-ruby@v1
|
28
21
|
with:
|
29
22
|
ruby-version: ${{ matrix.ruby-version }}
|
30
|
-
bundler
|
23
|
+
bundler: ${{ env.BUNDLER }}
|
24
|
+
bundler-cache: true
|
25
|
+
- run: bundle install
|
31
26
|
- run: bundle exec appraisal install
|
32
27
|
- run: bundle exec appraisal rake test
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
3.2.6
|
data/Appraisals
CHANGED
@@ -7,3 +7,13 @@ appraise "rails-7.0" do
|
|
7
7
|
gem 'activemodel', '~> 7.0.0'
|
8
8
|
gem 'actionpack', '~> 7.0.0'
|
9
9
|
end
|
10
|
+
|
11
|
+
appraise "rails-7.1" do
|
12
|
+
gem 'activemodel', '~> 7.1.0'
|
13
|
+
gem 'actionpack', '~> 7.1.0'
|
14
|
+
end
|
15
|
+
|
16
|
+
appraise "rails-7.2" do
|
17
|
+
gem 'activemodel', '~> 7.2.0'
|
18
|
+
gem 'actionpack', '~> 7.2.0'
|
19
|
+
end
|
data/CHANGELOG.MD
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
## Subroutine 4.1.1
|
2
|
+
|
3
|
+
Fields using the time/timestamp/datetime caster will now return exactly the passed in value
|
4
|
+
if it acts like a time object (`acts_like?(:time)`/`acts_like_time?`), instead of serializing
|
5
|
+
to string and re-parsing to a Time object. This fixes issues with losing usec precision.
|
6
|
+
|
1
7
|
## Subroutine 4.1.0
|
2
8
|
|
3
9
|
A field can no opt out of the natural assignment behavior of ActiveSupport::HashWithIndifferentAccess. Top level param groups are still accessible via indifferent access but if a field sets the `bypass_indifferent_assignment` option to `true` the HashWithIndifferentAccess assignment behavior will be bypassed in favor of direct Hash-like assignment.
|
data/Gemfile
CHANGED
@@ -5,7 +5,4 @@ source "https://rubygems.org"
|
|
5
5
|
# Specify your gem's dependencies in subroutine.gemspec
|
6
6
|
gemspec
|
7
7
|
|
8
|
-
|
9
|
-
# https://github.com/thoughtbot/appraisal/issues/211
|
10
|
-
# until appraisal v3 is released
|
11
|
-
gem "appraisal", github: "thoughtbot/appraisal", ref: "b200e636903"
|
8
|
+
gem "appraisal"
|
data/gemfiles/rails_6.1.gemfile
CHANGED
@@ -1,95 +1,91 @@
|
|
1
|
-
GIT
|
2
|
-
remote: https://github.com/thoughtbot/appraisal.git
|
3
|
-
revision: b200e636903700098bef25f4f51dbc4c46e4c04c
|
4
|
-
ref: b200e636903
|
5
|
-
specs:
|
6
|
-
appraisal (2.4.1)
|
7
|
-
bundler
|
8
|
-
rake
|
9
|
-
thor (>= 0.14.0)
|
10
|
-
|
11
1
|
PATH
|
12
2
|
remote: ..
|
13
3
|
specs:
|
14
|
-
subroutine (
|
4
|
+
subroutine (4.1.0)
|
15
5
|
activemodel (>= 6.1)
|
16
6
|
activesupport (>= 6.1)
|
17
7
|
|
18
8
|
GEM
|
19
9
|
remote: https://rubygems.org/
|
20
10
|
specs:
|
21
|
-
actionpack (6.1.7.
|
22
|
-
actionview (= 6.1.7.
|
23
|
-
activesupport (= 6.1.7.
|
11
|
+
actionpack (6.1.7.8)
|
12
|
+
actionview (= 6.1.7.8)
|
13
|
+
activesupport (= 6.1.7.8)
|
24
14
|
rack (~> 2.0, >= 2.0.9)
|
25
15
|
rack-test (>= 0.6.3)
|
26
16
|
rails-dom-testing (~> 2.0)
|
27
17
|
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
28
|
-
actionview (6.1.7.
|
29
|
-
activesupport (= 6.1.7.
|
18
|
+
actionview (6.1.7.8)
|
19
|
+
activesupport (= 6.1.7.8)
|
30
20
|
builder (~> 3.1)
|
31
21
|
erubi (~> 1.4)
|
32
22
|
rails-dom-testing (~> 2.0)
|
33
23
|
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
34
|
-
activemodel (6.1.7.
|
35
|
-
activesupport (= 6.1.7.
|
36
|
-
activesupport (6.1.7.
|
24
|
+
activemodel (6.1.7.8)
|
25
|
+
activesupport (= 6.1.7.8)
|
26
|
+
activesupport (6.1.7.8)
|
37
27
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
38
28
|
i18n (>= 1.6, < 2)
|
39
29
|
minitest (>= 5.1)
|
40
30
|
tzinfo (~> 2.0)
|
41
31
|
zeitwerk (~> 2.3)
|
42
32
|
ansi (1.5.0)
|
43
|
-
|
33
|
+
appraisal (2.5.0)
|
34
|
+
bundler
|
35
|
+
rake
|
36
|
+
thor (>= 0.14.0)
|
37
|
+
builder (3.3.0)
|
44
38
|
byebug (11.1.3)
|
45
|
-
concurrent-ruby (1.
|
39
|
+
concurrent-ruby (1.3.4)
|
46
40
|
crass (1.0.6)
|
47
|
-
erubi (1.
|
48
|
-
i18n (1.14.
|
41
|
+
erubi (1.13.0)
|
42
|
+
i18n (1.14.6)
|
49
43
|
concurrent-ruby (~> 1.0)
|
50
|
-
loofah (2.
|
44
|
+
loofah (2.22.0)
|
51
45
|
crass (~> 1.0.2)
|
52
46
|
nokogiri (>= 1.12.0)
|
53
|
-
m (1.6.
|
47
|
+
m (1.6.2)
|
54
48
|
method_source (>= 0.6.7)
|
55
49
|
rake (>= 0.9.2.2)
|
56
|
-
method_source (1.
|
57
|
-
|
58
|
-
minitest
|
50
|
+
method_source (1.1.0)
|
51
|
+
mini_portile2 (2.8.7)
|
52
|
+
minitest (5.25.1)
|
53
|
+
minitest-reporters (1.7.1)
|
59
54
|
ansi
|
60
55
|
builder
|
61
56
|
minitest (>= 5.0)
|
62
57
|
ruby-progressbar
|
63
|
-
mocha (2.
|
58
|
+
mocha (2.4.5)
|
64
59
|
ruby2_keywords (>= 0.0.5)
|
65
|
-
nokogiri (1.
|
60
|
+
nokogiri (1.16.7)
|
61
|
+
mini_portile2 (~> 2.8.2)
|
66
62
|
racc (~> 1.4)
|
67
|
-
racc (1.
|
68
|
-
rack (2.2.
|
63
|
+
racc (1.8.1)
|
64
|
+
rack (2.2.9)
|
69
65
|
rack-test (2.1.0)
|
70
66
|
rack (>= 1.3)
|
71
|
-
rails-dom-testing (2.0
|
72
|
-
activesupport (>=
|
67
|
+
rails-dom-testing (2.2.0)
|
68
|
+
activesupport (>= 5.0.0)
|
69
|
+
minitest
|
73
70
|
nokogiri (>= 1.6)
|
74
71
|
rails-html-sanitizer (1.6.0)
|
75
72
|
loofah (~> 2.21)
|
76
73
|
nokogiri (~> 1.14)
|
77
|
-
rake (13.
|
74
|
+
rake (13.2.1)
|
78
75
|
ruby-progressbar (1.13.0)
|
79
76
|
ruby2_keywords (0.0.5)
|
80
|
-
thor (1.
|
77
|
+
thor (1.3.2)
|
81
78
|
tzinfo (2.0.6)
|
82
79
|
concurrent-ruby (~> 1.0)
|
83
|
-
zeitwerk (2.6.
|
80
|
+
zeitwerk (2.6.18)
|
84
81
|
|
85
82
|
PLATFORMS
|
86
|
-
|
83
|
+
ruby
|
87
84
|
|
88
85
|
DEPENDENCIES
|
89
86
|
actionpack (~> 6.1.0)
|
90
87
|
activemodel (~> 6.1.0)
|
91
|
-
appraisal
|
92
|
-
bundler
|
88
|
+
appraisal
|
93
89
|
byebug
|
94
90
|
m
|
95
91
|
minitest
|
@@ -99,4 +95,4 @@ DEPENDENCIES
|
|
99
95
|
subroutine!
|
100
96
|
|
101
97
|
BUNDLED WITH
|
102
|
-
2.
|
98
|
+
2.5.22
|
data/gemfiles/rails_7.0.gemfile
CHANGED
@@ -1,93 +1,89 @@
|
|
1
|
-
GIT
|
2
|
-
remote: https://github.com/thoughtbot/appraisal.git
|
3
|
-
revision: b200e636903700098bef25f4f51dbc4c46e4c04c
|
4
|
-
ref: b200e636903
|
5
|
-
specs:
|
6
|
-
appraisal (2.4.1)
|
7
|
-
bundler
|
8
|
-
rake
|
9
|
-
thor (>= 0.14.0)
|
10
|
-
|
11
1
|
PATH
|
12
2
|
remote: ..
|
13
3
|
specs:
|
14
|
-
subroutine (
|
4
|
+
subroutine (4.1.0)
|
15
5
|
activemodel (>= 6.1)
|
16
6
|
activesupport (>= 6.1)
|
17
7
|
|
18
8
|
GEM
|
19
9
|
remote: https://rubygems.org/
|
20
10
|
specs:
|
21
|
-
actionpack (7.0.
|
22
|
-
actionview (= 7.0.
|
23
|
-
activesupport (= 7.0.
|
11
|
+
actionpack (7.0.8.4)
|
12
|
+
actionview (= 7.0.8.4)
|
13
|
+
activesupport (= 7.0.8.4)
|
24
14
|
rack (~> 2.0, >= 2.2.4)
|
25
15
|
rack-test (>= 0.6.3)
|
26
16
|
rails-dom-testing (~> 2.0)
|
27
17
|
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
28
|
-
actionview (7.0.
|
29
|
-
activesupport (= 7.0.
|
18
|
+
actionview (7.0.8.4)
|
19
|
+
activesupport (= 7.0.8.4)
|
30
20
|
builder (~> 3.1)
|
31
21
|
erubi (~> 1.4)
|
32
22
|
rails-dom-testing (~> 2.0)
|
33
23
|
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
34
|
-
activemodel (7.0.
|
35
|
-
activesupport (= 7.0.
|
36
|
-
activesupport (7.0.
|
24
|
+
activemodel (7.0.8.4)
|
25
|
+
activesupport (= 7.0.8.4)
|
26
|
+
activesupport (7.0.8.4)
|
37
27
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
38
28
|
i18n (>= 1.6, < 2)
|
39
29
|
minitest (>= 5.1)
|
40
30
|
tzinfo (~> 2.0)
|
41
31
|
ansi (1.5.0)
|
42
|
-
|
32
|
+
appraisal (2.5.0)
|
33
|
+
bundler
|
34
|
+
rake
|
35
|
+
thor (>= 0.14.0)
|
36
|
+
builder (3.3.0)
|
43
37
|
byebug (11.1.3)
|
44
|
-
concurrent-ruby (1.
|
38
|
+
concurrent-ruby (1.3.4)
|
45
39
|
crass (1.0.6)
|
46
|
-
erubi (1.
|
47
|
-
i18n (1.14.
|
40
|
+
erubi (1.13.0)
|
41
|
+
i18n (1.14.6)
|
48
42
|
concurrent-ruby (~> 1.0)
|
49
|
-
loofah (2.
|
43
|
+
loofah (2.22.0)
|
50
44
|
crass (~> 1.0.2)
|
51
45
|
nokogiri (>= 1.12.0)
|
52
|
-
m (1.6.
|
46
|
+
m (1.6.2)
|
53
47
|
method_source (>= 0.6.7)
|
54
48
|
rake (>= 0.9.2.2)
|
55
|
-
method_source (1.
|
56
|
-
|
57
|
-
minitest
|
49
|
+
method_source (1.1.0)
|
50
|
+
mini_portile2 (2.8.7)
|
51
|
+
minitest (5.25.1)
|
52
|
+
minitest-reporters (1.7.1)
|
58
53
|
ansi
|
59
54
|
builder
|
60
55
|
minitest (>= 5.0)
|
61
56
|
ruby-progressbar
|
62
|
-
mocha (2.
|
57
|
+
mocha (2.4.5)
|
63
58
|
ruby2_keywords (>= 0.0.5)
|
64
|
-
nokogiri (1.
|
59
|
+
nokogiri (1.16.7)
|
60
|
+
mini_portile2 (~> 2.8.2)
|
65
61
|
racc (~> 1.4)
|
66
|
-
racc (1.
|
67
|
-
rack (2.2.
|
62
|
+
racc (1.8.1)
|
63
|
+
rack (2.2.9)
|
68
64
|
rack-test (2.1.0)
|
69
65
|
rack (>= 1.3)
|
70
|
-
rails-dom-testing (2.0
|
71
|
-
activesupport (>=
|
66
|
+
rails-dom-testing (2.2.0)
|
67
|
+
activesupport (>= 5.0.0)
|
68
|
+
minitest
|
72
69
|
nokogiri (>= 1.6)
|
73
70
|
rails-html-sanitizer (1.6.0)
|
74
71
|
loofah (~> 2.21)
|
75
72
|
nokogiri (~> 1.14)
|
76
|
-
rake (13.
|
73
|
+
rake (13.2.1)
|
77
74
|
ruby-progressbar (1.13.0)
|
78
75
|
ruby2_keywords (0.0.5)
|
79
|
-
thor (1.
|
76
|
+
thor (1.3.2)
|
80
77
|
tzinfo (2.0.6)
|
81
78
|
concurrent-ruby (~> 1.0)
|
82
79
|
|
83
80
|
PLATFORMS
|
84
|
-
|
81
|
+
ruby
|
85
82
|
|
86
83
|
DEPENDENCIES
|
87
84
|
actionpack (~> 7.0.0)
|
88
85
|
activemodel (~> 7.0.0)
|
89
|
-
appraisal
|
90
|
-
bundler
|
86
|
+
appraisal
|
91
87
|
byebug
|
92
88
|
m
|
93
89
|
minitest
|
@@ -97,4 +93,4 @@ DEPENDENCIES
|
|
97
93
|
subroutine!
|
98
94
|
|
99
95
|
BUNDLED WITH
|
100
|
-
2.
|
96
|
+
2.5.22
|
@@ -0,0 +1,109 @@
|
|
1
|
+
PATH
|
2
|
+
remote: ..
|
3
|
+
specs:
|
4
|
+
subroutine (4.1.0)
|
5
|
+
activemodel (>= 6.1)
|
6
|
+
activesupport (>= 6.1)
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: https://rubygems.org/
|
10
|
+
specs:
|
11
|
+
actionpack (7.1.4)
|
12
|
+
actionview (= 7.1.4)
|
13
|
+
activesupport (= 7.1.4)
|
14
|
+
nokogiri (>= 1.8.5)
|
15
|
+
racc
|
16
|
+
rack (>= 2.2.4)
|
17
|
+
rack-session (>= 1.0.1)
|
18
|
+
rack-test (>= 0.6.3)
|
19
|
+
rails-dom-testing (~> 2.2)
|
20
|
+
rails-html-sanitizer (~> 1.6)
|
21
|
+
actionview (7.1.4)
|
22
|
+
activesupport (= 7.1.4)
|
23
|
+
builder (~> 3.1)
|
24
|
+
erubi (~> 1.11)
|
25
|
+
rails-dom-testing (~> 2.2)
|
26
|
+
rails-html-sanitizer (~> 1.6)
|
27
|
+
activemodel (7.1.4)
|
28
|
+
activesupport (= 7.1.4)
|
29
|
+
activesupport (7.1.4)
|
30
|
+
base64
|
31
|
+
bigdecimal
|
32
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
33
|
+
connection_pool (>= 2.2.5)
|
34
|
+
drb
|
35
|
+
i18n (>= 1.6, < 2)
|
36
|
+
minitest (>= 5.1)
|
37
|
+
mutex_m
|
38
|
+
tzinfo (~> 2.0)
|
39
|
+
ansi (1.5.0)
|
40
|
+
appraisal (2.5.0)
|
41
|
+
bundler
|
42
|
+
rake
|
43
|
+
thor (>= 0.14.0)
|
44
|
+
base64 (0.2.0)
|
45
|
+
bigdecimal (3.1.8)
|
46
|
+
builder (3.3.0)
|
47
|
+
byebug (11.1.3)
|
48
|
+
concurrent-ruby (1.3.4)
|
49
|
+
connection_pool (2.4.1)
|
50
|
+
crass (1.0.6)
|
51
|
+
drb (2.2.1)
|
52
|
+
erubi (1.13.0)
|
53
|
+
i18n (1.14.6)
|
54
|
+
concurrent-ruby (~> 1.0)
|
55
|
+
loofah (2.22.0)
|
56
|
+
crass (~> 1.0.2)
|
57
|
+
nokogiri (>= 1.12.0)
|
58
|
+
m (1.6.2)
|
59
|
+
method_source (>= 0.6.7)
|
60
|
+
rake (>= 0.9.2.2)
|
61
|
+
method_source (1.1.0)
|
62
|
+
minitest (5.25.1)
|
63
|
+
minitest-reporters (1.7.1)
|
64
|
+
ansi
|
65
|
+
builder
|
66
|
+
minitest (>= 5.0)
|
67
|
+
ruby-progressbar
|
68
|
+
mocha (2.4.5)
|
69
|
+
ruby2_keywords (>= 0.0.5)
|
70
|
+
mutex_m (0.2.0)
|
71
|
+
nokogiri (1.16.7-arm64-darwin)
|
72
|
+
racc (~> 1.4)
|
73
|
+
racc (1.8.1)
|
74
|
+
rack (3.1.7)
|
75
|
+
rack-session (2.0.0)
|
76
|
+
rack (>= 3.0.0)
|
77
|
+
rack-test (2.1.0)
|
78
|
+
rack (>= 1.3)
|
79
|
+
rails-dom-testing (2.2.0)
|
80
|
+
activesupport (>= 5.0.0)
|
81
|
+
minitest
|
82
|
+
nokogiri (>= 1.6)
|
83
|
+
rails-html-sanitizer (1.6.0)
|
84
|
+
loofah (~> 2.21)
|
85
|
+
nokogiri (~> 1.14)
|
86
|
+
rake (13.2.1)
|
87
|
+
ruby-progressbar (1.13.0)
|
88
|
+
ruby2_keywords (0.0.5)
|
89
|
+
thor (1.3.2)
|
90
|
+
tzinfo (2.0.6)
|
91
|
+
concurrent-ruby (~> 1.0)
|
92
|
+
|
93
|
+
PLATFORMS
|
94
|
+
arm64-darwin
|
95
|
+
|
96
|
+
DEPENDENCIES
|
97
|
+
actionpack (~> 7.1.0)
|
98
|
+
activemodel (~> 7.1.0)
|
99
|
+
appraisal
|
100
|
+
byebug
|
101
|
+
m
|
102
|
+
minitest
|
103
|
+
minitest-reporters
|
104
|
+
mocha
|
105
|
+
rake
|
106
|
+
subroutine!
|
107
|
+
|
108
|
+
BUNDLED WITH
|
109
|
+
2.5.22
|
@@ -0,0 +1,113 @@
|
|
1
|
+
PATH
|
2
|
+
remote: ..
|
3
|
+
specs:
|
4
|
+
subroutine (4.1.0)
|
5
|
+
activemodel (>= 6.1)
|
6
|
+
activesupport (>= 6.1)
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: https://rubygems.org/
|
10
|
+
specs:
|
11
|
+
actionpack (7.2.1)
|
12
|
+
actionview (= 7.2.1)
|
13
|
+
activesupport (= 7.2.1)
|
14
|
+
nokogiri (>= 1.8.5)
|
15
|
+
racc
|
16
|
+
rack (>= 2.2.4, < 3.2)
|
17
|
+
rack-session (>= 1.0.1)
|
18
|
+
rack-test (>= 0.6.3)
|
19
|
+
rails-dom-testing (~> 2.2)
|
20
|
+
rails-html-sanitizer (~> 1.6)
|
21
|
+
useragent (~> 0.16)
|
22
|
+
actionview (7.2.1)
|
23
|
+
activesupport (= 7.2.1)
|
24
|
+
builder (~> 3.1)
|
25
|
+
erubi (~> 1.11)
|
26
|
+
rails-dom-testing (~> 2.2)
|
27
|
+
rails-html-sanitizer (~> 1.6)
|
28
|
+
activemodel (7.2.1)
|
29
|
+
activesupport (= 7.2.1)
|
30
|
+
activesupport (7.2.1)
|
31
|
+
base64
|
32
|
+
bigdecimal
|
33
|
+
concurrent-ruby (~> 1.0, >= 1.3.1)
|
34
|
+
connection_pool (>= 2.2.5)
|
35
|
+
drb
|
36
|
+
i18n (>= 1.6, < 2)
|
37
|
+
logger (>= 1.4.2)
|
38
|
+
minitest (>= 5.1)
|
39
|
+
securerandom (>= 0.3)
|
40
|
+
tzinfo (~> 2.0, >= 2.0.5)
|
41
|
+
ansi (1.5.0)
|
42
|
+
appraisal (2.5.0)
|
43
|
+
bundler
|
44
|
+
rake
|
45
|
+
thor (>= 0.14.0)
|
46
|
+
base64 (0.2.0)
|
47
|
+
bigdecimal (3.1.8)
|
48
|
+
builder (3.3.0)
|
49
|
+
byebug (11.1.3)
|
50
|
+
concurrent-ruby (1.3.4)
|
51
|
+
connection_pool (2.4.1)
|
52
|
+
crass (1.0.6)
|
53
|
+
drb (2.2.1)
|
54
|
+
erubi (1.13.0)
|
55
|
+
i18n (1.14.6)
|
56
|
+
concurrent-ruby (~> 1.0)
|
57
|
+
logger (1.6.1)
|
58
|
+
loofah (2.22.0)
|
59
|
+
crass (~> 1.0.2)
|
60
|
+
nokogiri (>= 1.12.0)
|
61
|
+
m (1.6.2)
|
62
|
+
method_source (>= 0.6.7)
|
63
|
+
rake (>= 0.9.2.2)
|
64
|
+
method_source (1.1.0)
|
65
|
+
minitest (5.25.1)
|
66
|
+
minitest-reporters (1.7.1)
|
67
|
+
ansi
|
68
|
+
builder
|
69
|
+
minitest (>= 5.0)
|
70
|
+
ruby-progressbar
|
71
|
+
mocha (2.4.5)
|
72
|
+
ruby2_keywords (>= 0.0.5)
|
73
|
+
nokogiri (1.16.7-arm64-darwin)
|
74
|
+
racc (~> 1.4)
|
75
|
+
racc (1.8.1)
|
76
|
+
rack (3.1.7)
|
77
|
+
rack-session (2.0.0)
|
78
|
+
rack (>= 3.0.0)
|
79
|
+
rack-test (2.1.0)
|
80
|
+
rack (>= 1.3)
|
81
|
+
rails-dom-testing (2.2.0)
|
82
|
+
activesupport (>= 5.0.0)
|
83
|
+
minitest
|
84
|
+
nokogiri (>= 1.6)
|
85
|
+
rails-html-sanitizer (1.6.0)
|
86
|
+
loofah (~> 2.21)
|
87
|
+
nokogiri (~> 1.14)
|
88
|
+
rake (13.2.1)
|
89
|
+
ruby-progressbar (1.13.0)
|
90
|
+
ruby2_keywords (0.0.5)
|
91
|
+
securerandom (0.3.1)
|
92
|
+
thor (1.3.2)
|
93
|
+
tzinfo (2.0.6)
|
94
|
+
concurrent-ruby (~> 1.0)
|
95
|
+
useragent (0.16.10)
|
96
|
+
|
97
|
+
PLATFORMS
|
98
|
+
arm64-darwin
|
99
|
+
|
100
|
+
DEPENDENCIES
|
101
|
+
actionpack (~> 7.2.0)
|
102
|
+
activemodel (~> 7.2.0)
|
103
|
+
appraisal
|
104
|
+
byebug
|
105
|
+
m
|
106
|
+
minitest
|
107
|
+
minitest-reporters
|
108
|
+
mocha
|
109
|
+
rake
|
110
|
+
subroutine!
|
111
|
+
|
112
|
+
BUNDLED WITH
|
113
|
+
2.5.22
|
@@ -4,9 +4,11 @@ require 'date'
|
|
4
4
|
require 'time'
|
5
5
|
require 'bigdecimal'
|
6
6
|
require 'securerandom'
|
7
|
+
require 'active_support/core_ext/object/acts_like'
|
7
8
|
require 'active_support/core_ext/object/blank'
|
8
9
|
require 'active_support/core_ext/object/try'
|
9
10
|
require 'active_support/core_ext/array/wrap'
|
11
|
+
require 'active_support/core_ext/time/acts_like'
|
10
12
|
|
11
13
|
module Subroutine
|
12
14
|
module TypeCaster
|
@@ -118,7 +120,11 @@ end
|
|
118
120
|
::Subroutine::TypeCaster.register :time, :timestamp, :datetime do |value, _options = {}|
|
119
121
|
next nil unless value.present?
|
120
122
|
|
121
|
-
|
123
|
+
if value.try(:acts_like?, :time)
|
124
|
+
value
|
125
|
+
else
|
126
|
+
::Time.parse(String(value))
|
127
|
+
end
|
122
128
|
end
|
123
129
|
|
124
130
|
::Subroutine::TypeCaster.register :hash, :object, :hashmap, :dict do |value, _options = {}|
|
data/lib/subroutine/version.rb
CHANGED
data/subroutine.gemspec
CHANGED
@@ -23,7 +23,6 @@ Gem::Specification.new do |spec|
|
|
23
23
|
spec.add_dependency "activesupport", ">= 6.1"
|
24
24
|
|
25
25
|
spec.add_development_dependency "actionpack", ">= 6.1"
|
26
|
-
spec.add_development_dependency "bundler"
|
27
26
|
spec.add_development_dependency "byebug"
|
28
27
|
spec.add_development_dependency "m"
|
29
28
|
spec.add_development_dependency "minitest"
|
@@ -345,5 +345,20 @@ module Subroutine
|
|
345
345
|
assert_nil op.user
|
346
346
|
end
|
347
347
|
|
348
|
+
def test_inheritable_options_are_inherited_by_child_fields
|
349
|
+
Subroutine.stubs(:inheritable_field_options).returns(%i[foo bar])
|
350
|
+
klass = Class.new(OpWithAssociation) do
|
351
|
+
association :buster, foo: true, bar: false, baz: true
|
352
|
+
association :mister, polymorphic: true, foo: true, bar: false, baz: true
|
353
|
+
end
|
354
|
+
|
355
|
+
%i[buster_id mister_id mister_type].each do |field_name|
|
356
|
+
field = klass.field_configurations.fetch(field_name)
|
357
|
+
assert_equal true, field[:foo]
|
358
|
+
assert_equal false, field[:bar]
|
359
|
+
assert_equal false, field.config.key?(:baz)
|
360
|
+
end
|
361
|
+
end
|
362
|
+
|
348
363
|
end
|
349
364
|
end
|
@@ -284,7 +284,7 @@ module Subroutine
|
|
284
284
|
assert_equal 0, op.time_input.min
|
285
285
|
assert_equal 0, op.time_input.sec
|
286
286
|
|
287
|
-
op.time_input = '2023-05-05T10:00:
|
287
|
+
op.time_input = '2023-05-05T10:00:30.123456Z'
|
288
288
|
assert_equal ::Time, op.time_input.class
|
289
289
|
refute_equal ::DateTime, op.time_input.class
|
290
290
|
|
@@ -294,6 +294,12 @@ module Subroutine
|
|
294
294
|
assert_equal 10, op.time_input.hour
|
295
295
|
assert_equal 0, op.time_input.min
|
296
296
|
assert_equal 30, op.time_input.sec
|
297
|
+
assert_equal 123456, op.time_input.usec
|
298
|
+
|
299
|
+
time = Time.at(1678741605.123456)
|
300
|
+
op.time_input = time
|
301
|
+
assert_equal time, op.time_input
|
302
|
+
assert_equal time.object_id, op.time_input.object_id
|
297
303
|
end
|
298
304
|
|
299
305
|
def test_iso_date_inputs
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: subroutine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.1.
|
4
|
+
version: 4.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Nelson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-11-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|
@@ -52,20 +52,6 @@ dependencies:
|
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '6.1'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: bundler
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - ">="
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '0'
|
62
|
-
type: :development
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - ">="
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: '0'
|
69
55
|
- !ruby/object:Gem::Dependency
|
70
56
|
name: byebug
|
71
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -157,6 +143,7 @@ executables: []
|
|
157
143
|
extensions: []
|
158
144
|
extra_rdoc_files: []
|
159
145
|
files:
|
146
|
+
- ".bundler-version"
|
160
147
|
- ".github/CODEOWNERS"
|
161
148
|
- ".github/dependabot.yml"
|
162
149
|
- ".github/workflows/build.yml"
|
@@ -173,6 +160,10 @@ files:
|
|
173
160
|
- gemfiles/rails_6.1.gemfile.lock
|
174
161
|
- gemfiles/rails_7.0.gemfile
|
175
162
|
- gemfiles/rails_7.0.gemfile.lock
|
163
|
+
- gemfiles/rails_7.1.gemfile
|
164
|
+
- gemfiles/rails_7.1.gemfile.lock
|
165
|
+
- gemfiles/rails_7.2.gemfile
|
166
|
+
- gemfiles/rails_7.2.gemfile.lock
|
176
167
|
- lib/subroutine.rb
|
177
168
|
- lib/subroutine/association_fields.rb
|
178
169
|
- lib/subroutine/association_fields/association_type_mismatch_error.rb
|
@@ -230,6 +221,10 @@ test_files:
|
|
230
221
|
- gemfiles/rails_6.1.gemfile.lock
|
231
222
|
- gemfiles/rails_7.0.gemfile
|
232
223
|
- gemfiles/rails_7.0.gemfile.lock
|
224
|
+
- gemfiles/rails_7.1.gemfile
|
225
|
+
- gemfiles/rails_7.1.gemfile.lock
|
226
|
+
- gemfiles/rails_7.2.gemfile
|
227
|
+
- gemfiles/rails_7.2.gemfile.lock
|
233
228
|
- test/subroutine/association_test.rb
|
234
229
|
- test/subroutine/auth_test.rb
|
235
230
|
- test/subroutine/base_test.rb
|