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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0bb790119c0be6db1ea5e9c0337b75db99a15ae3
4
- data.tar.gz: ee1ed0dcf813732a24347107fe08ad1f5c1485ac
3
+ metadata.gz: 6fa7fbb849eee0f5e5bd59009b24b1afdbe7c1c5
4
+ data.tar.gz: b1993bfb01fbe59835bbed807781c8896f062118
5
5
  SHA512:
6
- metadata.gz: 3c05ab3551ec4447387a98ffe3dbd2a5832776de6d6b7d8e767301524b8a9a5e3f8ad640401d8496576e56efc515c0380aa31b5f4a0ccb93d31afe0cbf910457
7
- data.tar.gz: 0972d63b3d70e44d32d5d3024e9767996bee2d618f43277b6e4f83632cf2def2e98613542450839efd60f880182cef96263d0814d82ba91a0e7d9035bbad17e4
6
+ metadata.gz: 71af57f0420f8799d97922f5af694becb42e7b3b636be6e58747cb171ef0dcf90e919e4778af12d9482bcd54a4f44e29c1a4bceda314db310058b5747ce6d2c3
7
+ data.tar.gz: 668aa30efbe8f13c971b613812f3d5e00ebe842002ed112ed5710b78f1d39acaa4cdea50da1a3e6382db03e9678059f107c8d2b5c6c5836b777c0ee9b1d41890
@@ -16,8 +16,9 @@ module Traits
16
16
  else
17
17
  case obj
18
18
  when String, Symbol
19
- s = obj.kind_of?(Symbol) ? obj.to_s : obj
20
- s.camelize.safe_constantize || s.tr('_', '/').camelize.safe_constantize
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
@@ -2,5 +2,5 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module Traits
5
- VERSION = '1.1.0'
5
+ VERSION = '1.1.1'
6
6
  end
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.0
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-10-23 00:00:00.000000000 Z
11
+ date: 2016-11-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport