activerecord-traits 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/traits/utilities.rb +3 -2
- data/lib/traits/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6fa7fbb849eee0f5e5bd59009b24b1afdbe7c1c5
|
4
|
+
data.tar.gz: b1993bfb01fbe59835bbed807781c8896f062118
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 71af57f0420f8799d97922f5af694becb42e7b3b636be6e58747cb171ef0dcf90e919e4778af12d9482bcd54a4f44e29c1a4bceda314db310058b5747ce6d2c3
|
7
|
+
data.tar.gz: 668aa30efbe8f13c971b613812f3d5e00ebe842002ed112ed5710b78f1d39acaa4cdea50da1a3e6382db03e9678059f107c8d2b5c6c5836b777c0ee9b1d41890
|
data/lib/traits/utilities.rb
CHANGED
@@ -16,8 +16,9 @@ module Traits
|
|
16
16
|
else
|
17
17
|
case obj
|
18
18
|
when String, Symbol
|
19
|
-
|
20
|
-
|
19
|
+
str = (obj.kind_of?(Symbol) ? obj.to_s : obj).underscore.singularize
|
20
|
+
kls = str.camelize.safe_constantize || str.tr('_', '/').camelize.safe_constantize
|
21
|
+
kls if active_record_descendant?(kls)
|
21
22
|
|
22
23
|
when Traits::Model, Traits::Attribute
|
23
24
|
obj.active_record
|
data/lib/traits/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activerecord-traits
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yaroslav Konoplov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-11-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|