bsm_models 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/bsm/model/sti_convertable.rb +2 -0
- metadata +3 -3
@@ -15,6 +15,8 @@ module Bsm::Model::StiConvertable
|
|
15
15
|
# @Override: Allow to specify a kind
|
16
16
|
def new(attributes = nil, *args, &block)
|
17
17
|
kind = (attributes = attributes.with_indifferent_access).delete(:kind) if attributes.is_a?(Hash)
|
18
|
+
return super if real_type?
|
19
|
+
|
18
20
|
klass = real_descendants.find {|k| k.kind == kind } || fallback_descendant
|
19
21
|
return super if klass == self
|
20
22
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bsm_models
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 31
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 4
|
10
|
+
version: 0.2.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Dimitrij Denissenko
|