sti_type_customizable 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sti_type_customizable/version.rb +1 -1
- data/lib/sti_type_customizable.rb +10 -10
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a9c1bc719744e9fbc3b543e02ca3efe920074f46
|
4
|
+
data.tar.gz: 0cb6f86687217180cd14efe8df973fbc181f185e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7bb8abcaad696553ff80577f8ab48658e3f380de87fffa1d55c0945fda89811d7fb598029fdda531cf6d9203eda1b99ae47ad540b200f2d238355dd74523cb9b
|
7
|
+
data.tar.gz: 3d2bb3d6e21888fbf17117de17d06ec5a99cc540f164413edddee0c1467751278c907f3f6480b0e52e9aab7c68175e1a34c0f033b692281605f172db12134ee8
|
@@ -11,23 +11,23 @@ module StiTypeCustomizable
|
|
11
11
|
|
12
12
|
class_methods do
|
13
13
|
def sti_child_classes(classes)
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
14
|
+
@sti_entities ||= begin
|
15
|
+
{}.tap do |entities|
|
16
|
+
classes.each do |klass|
|
17
|
+
raise NotImplementedError unless klass.include? StiTypeCustomizable
|
18
18
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
19
|
+
entities[klass.sti_type_value] = klass
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
23
|
end
|
24
24
|
|
25
25
|
def find_sti_class(type)
|
26
|
-
|
26
|
+
@sti_entities[type] || self
|
27
27
|
end
|
28
28
|
|
29
29
|
def sti_name
|
30
|
-
|
30
|
+
@sti_entities.invert[self] || self::sti_type_value
|
31
31
|
end
|
32
32
|
end
|
33
33
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sti_type_customizable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Takahiro Ooishi
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-11-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -105,7 +105,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
105
105
|
version: '0'
|
106
106
|
requirements: []
|
107
107
|
rubyforge_project:
|
108
|
-
rubygems_version: 2.5.
|
108
|
+
rubygems_version: 2.5.2
|
109
109
|
signing_key:
|
110
110
|
specification_version: 4
|
111
111
|
summary: Customize STI type column
|