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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0d5e8b38a94d15e5cf3697a1b2c7a62d8b6cbf34
4
- data.tar.gz: 2dd01a8b5bdb5b729b1ea218a913addc35d65311
3
+ metadata.gz: a9c1bc719744e9fbc3b543e02ca3efe920074f46
4
+ data.tar.gz: 0cb6f86687217180cd14efe8df973fbc181f185e
5
5
  SHA512:
6
- metadata.gz: dd862359678ccea92a0da976e7e306f6edf97156a50af53731aab42e7190ca3af1abc1135e53c4faf6313a2ee4c7aaede0d92344cd2fc906c3a936e908bf8bd4
7
- data.tar.gz: 1dec2dfd0ca42ac98c585491b91343fc6db5d5f753d5addc1dc810ee17a102ac9c48ec7b58f3997186aba0c1e6bda1c211fb56ddc840cbd6a1d3b6c23bc01925
6
+ metadata.gz: 7bb8abcaad696553ff80577f8ab48658e3f380de87fffa1d55c0945fda89811d7fb598029fdda531cf6d9203eda1b99ae47ad540b200f2d238355dd74523cb9b
7
+ data.tar.gz: 3d2bb3d6e21888fbf17117de17d06ec5a99cc540f164413edddee0c1467751278c907f3f6480b0e52e9aab7c68175e1a34c0f033b692281605f172db12134ee8
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module StiTypeCustomizable
3
- VERSION = "0.2.0"
3
+ VERSION = "0.3.0"
4
4
  end
@@ -11,23 +11,23 @@ module StiTypeCustomizable
11
11
 
12
12
  class_methods do
13
13
  def sti_child_classes(classes)
14
- @@sti_entities ||= begin
15
- {}.tap do |entities|
16
- classes.each do |klass|
17
- raise NotImplementedError unless klass.include? StiTypeCustomizable
14
+ @sti_entities ||= begin
15
+ {}.tap do |entities|
16
+ classes.each do |klass|
17
+ raise NotImplementedError unless klass.include? StiTypeCustomizable
18
18
 
19
- entities[klass.sti_type_value] = klass
20
- end
21
- end
22
- end
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
- @@sti_entities[type] || self
26
+ @sti_entities[type] || self
27
27
  end
28
28
 
29
29
  def sti_name
30
- @@sti_entities.invert[self] || self::sti_type_value
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.2.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-09-22 00:00:00.000000000 Z
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.1
108
+ rubygems_version: 2.5.2
109
109
  signing_key:
110
110
  specification_version: 4
111
111
  summary: Customize STI type column