scopiform 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/scopiform/core.rb +7 -3
- data/lib/scopiform/helpers.rb +1 -1
- data/lib/scopiform/scope_definition.rb +1 -1
- data/lib/scopiform/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3410bc990d8cdf96301ed976fd2a604f19712ec559a6e7a0e2eb8f384f887ba4
|
4
|
+
data.tar.gz: ff9cf85f92087f0cca007130236776532617002c4dfb9e8f557dc2f96b744d1f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7000af69a75cad3e5092d27567280207a3301f6dd507b66d1477ee6695aee22de7ff48b9f547644ae4bb597d6289690f885e1f903dd1710c7513dffa4a14512d
|
7
|
+
data.tar.gz: 1c91fb0c3b91dfd73049fc80f1c09895d987ee125754a912ec0a70c55a8833b5db4c858d102569bb78d7f47dd266b1d65ea6e5caf2c7465297804cf419969bfc
|
data/lib/scopiform/core.rb
CHANGED
@@ -18,7 +18,7 @@ module Scopiform
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def auto_scope?(name)
|
21
|
-
auto_scopes.find { |scope| scope.name == name }
|
21
|
+
auto_scopes.find { |scope| scope.name == name }.present?
|
22
22
|
end
|
23
23
|
|
24
24
|
def auto_scope_add(attribute, block, prefix: nil, suffix: nil, **options)
|
@@ -58,7 +58,7 @@ module Scopiform
|
|
58
58
|
end
|
59
59
|
|
60
60
|
if scope.options[:remove_for_enum]
|
61
|
-
singleton_class.remove_method scope.name
|
61
|
+
singleton_class.send(:remove_method, scope.name)
|
62
62
|
@auto_scopes.delete(scope)
|
63
63
|
end
|
64
64
|
end
|
@@ -74,7 +74,11 @@ module Scopiform
|
|
74
74
|
|
75
75
|
def auto_scope_for_alias(alias_name, scope_definition)
|
76
76
|
alias_scope_definition = scope_definition.dup
|
77
|
-
alias_scope_definition.attribute = alias_name
|
77
|
+
alias_scope_definition.attribute = alias_name.to_sym
|
78
|
+
|
79
|
+
@auto_scopes ||= []
|
80
|
+
@auto_scopes << alias_scope_definition
|
81
|
+
|
78
82
|
singleton_class.send(:alias_method, alias_scope_definition.name, scope_definition.name)
|
79
83
|
end
|
80
84
|
end
|
data/lib/scopiform/helpers.rb
CHANGED
data/lib/scopiform/version.rb
CHANGED