active_manageable 0.1.0 → 0.1.1
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 +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +4 -4
- data/lib/active_manageable/base.rb +1 -1
- data/lib/active_manageable/methods/auxiliary/scopes.rb +2 -3
- data/lib/active_manageable/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bcd23b958961bff43311ec982bf403781ef627e80bdd3590925d959cabffa0ac
|
4
|
+
data.tar.gz: a606d7aa036a0f1b32fe67938227b2d4d222ffb0e07231e4d23f040c80b123b5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 75636fe23bccc6798163e4364502d87fca2d27bc6e14ecb8894d87d7e6d77edb2c0b20215b76e9a63380d7a415ec40c05ed02c9a198051d28c5bdbd79393405c
|
7
|
+
data.tar.gz: b6943d61f0ec7aeac2d3c633cc9fa445d47b154b9c44804455984a02eed06a59b54715f4d9969817bb1ec606e5e19d7a28219fa1a9edc9a65013f4ccc10e14e6
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
active_manageable (0.1.
|
4
|
+
active_manageable (0.1.1)
|
5
5
|
activerecord (>= 6.0)
|
6
6
|
activesupport (>= 6.0)
|
7
7
|
flexitime (~> 1.0)
|
@@ -71,9 +71,9 @@ GEM
|
|
71
71
|
nokogiri (>= 1.5.9)
|
72
72
|
method_source (1.0.0)
|
73
73
|
minitest (5.15.0)
|
74
|
-
nokogiri (1.13.
|
74
|
+
nokogiri (1.13.4-arm64-darwin)
|
75
75
|
racc (~> 1.4)
|
76
|
-
nokogiri (1.13.
|
76
|
+
nokogiri (1.13.4-x86_64-linux)
|
77
77
|
racc (~> 1.4)
|
78
78
|
parallel (1.21.0)
|
79
79
|
parser (3.0.3.2)
|
@@ -93,7 +93,7 @@ GEM
|
|
93
93
|
nokogiri (>= 1.6)
|
94
94
|
rails-html-sanitizer (1.4.2)
|
95
95
|
loofah (~> 2.3)
|
96
|
-
rails-i18n (7.0.
|
96
|
+
rails-i18n (7.0.3)
|
97
97
|
i18n (>= 0.7, < 2)
|
98
98
|
railties (>= 6.0.0, < 8)
|
99
99
|
railties (7.0.0)
|
@@ -89,7 +89,7 @@ module ActiveManageable
|
|
89
89
|
end
|
90
90
|
|
91
91
|
def add_method_defaults(key:, value:, methods:)
|
92
|
-
methods = Array(methods).map(&:to_sym)
|
92
|
+
methods = Array.wrap(methods).map(&:to_sym)
|
93
93
|
methods << :all if methods.empty?
|
94
94
|
defaults[key] ||= {}
|
95
95
|
methods.each { |method| defaults[key][method] = value }
|
@@ -35,15 +35,14 @@ module ActiveManageable
|
|
35
35
|
# and value containing an array of scope arguments.
|
36
36
|
def get_scopes(scopes = nil)
|
37
37
|
scopes ||= defaults[:scopes]
|
38
|
-
scopes = scopes.is_a?(Hash) ? [scopes] : Array(scopes)
|
39
38
|
|
40
|
-
scopes.map do |scope|
|
39
|
+
Array.wrap(scopes).map do |scope|
|
41
40
|
case scope
|
42
41
|
when Symbol, String
|
43
42
|
{scope => []}
|
44
43
|
when Hash
|
45
44
|
# ensure values are an array so they can be passed to the scope using splat operator
|
46
|
-
scope.transform_values! { |v| Array(v) }
|
45
|
+
scope.transform_values! { |v| Array.wrap(v) }
|
47
46
|
when Proc
|
48
47
|
# if the class default contains a lambda/proc that returns nil
|
49
48
|
# don't call get_scopes as we don't want to end up in an infinite loop
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_manageable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Hilton
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2022-
|
12
|
+
date: 2022-04-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activerecord
|