symbolize 3.1.2 → 3.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/symbolize.rb +2 -1
- data/spec/symbolize_spec.rb +5 -0
- data/symbolize.gemspec +4 -3
- metadata +16 -4
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.1.
|
1
|
+
3.1.3
|
data/lib/symbolize.rb
CHANGED
@@ -153,7 +153,8 @@ module Symbolize
|
|
153
153
|
|
154
154
|
# Return an attribute's i18n
|
155
155
|
def read_i18n_attribute attr_name
|
156
|
-
|
156
|
+
return nil unless attr = read_attribute(attr_name)
|
157
|
+
I18n.translate("activerecord.attributes.#{ActiveSupport::Inflector.underscore(self.class)}.enums.#{attr_name}.#{attr}") #.to_sym rescue nila
|
157
158
|
end
|
158
159
|
|
159
160
|
# Write a symbolized value. Watch out for booleans.
|
data/spec/symbolize_spec.rb
CHANGED
@@ -244,6 +244,11 @@ describe "Symbolize" do
|
|
244
244
|
@skill.kind_text.should eql("Mágica")
|
245
245
|
end
|
246
246
|
|
247
|
+
it "should return nil if there's no value" do
|
248
|
+
@skill = UserSkill.create(:kind => nil)
|
249
|
+
@skill.kind_text.should be_nil
|
250
|
+
end
|
251
|
+
|
247
252
|
end
|
248
253
|
|
249
254
|
describe "Methods" do
|
data/symbolize.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{symbolize}
|
8
|
-
s.version = "3.1.
|
8
|
+
s.version = "3.1.3"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Marcos Piccinini"]
|
12
|
-
s.date = %q{2011-
|
12
|
+
s.date = %q{2011-04-18}
|
13
13
|
s.description = %q{ActiveRecord enums with i18n}
|
14
14
|
s.email = %q{x@nofxx.com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -35,7 +35,7 @@ Gem::Specification.new do |s|
|
|
35
35
|
]
|
36
36
|
s.homepage = %q{http://github.com/nofxx/symbolize}
|
37
37
|
s.require_paths = ["lib"]
|
38
|
-
s.rubygems_version = %q{1.
|
38
|
+
s.rubygems_version = %q{1.3.7}
|
39
39
|
s.summary = %q{ActiveRecord enums with i18n}
|
40
40
|
s.test_files = [
|
41
41
|
"spec/db/create_testing_structure.rb",
|
@@ -44,6 +44,7 @@ Gem::Specification.new do |s|
|
|
44
44
|
]
|
45
45
|
|
46
46
|
if s.respond_to? :specification_version then
|
47
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
47
48
|
s.specification_version = 3
|
48
49
|
|
49
50
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
metadata
CHANGED
@@ -1,8 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: symbolize
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
prerelease:
|
5
|
-
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 3
|
7
|
+
- 1
|
8
|
+
- 3
|
9
|
+
version: 3.1.3
|
6
10
|
platform: ruby
|
7
11
|
authors:
|
8
12
|
- Marcos Piccinini
|
@@ -10,7 +14,7 @@ autorequire:
|
|
10
14
|
bindir: bin
|
11
15
|
cert_chain: []
|
12
16
|
|
13
|
-
date: 2011-
|
17
|
+
date: 2011-04-18 00:00:00 -03:00
|
14
18
|
default_executable:
|
15
19
|
dependencies:
|
16
20
|
- !ruby/object:Gem::Dependency
|
@@ -21,6 +25,8 @@ dependencies:
|
|
21
25
|
requirements:
|
22
26
|
- - ">="
|
23
27
|
- !ruby/object:Gem::Version
|
28
|
+
segments:
|
29
|
+
- 0
|
24
30
|
version: "0"
|
25
31
|
type: :development
|
26
32
|
version_requirements: *id001
|
@@ -32,6 +38,8 @@ dependencies:
|
|
32
38
|
requirements:
|
33
39
|
- - ">="
|
34
40
|
- !ruby/object:Gem::Version
|
41
|
+
segments:
|
42
|
+
- 0
|
35
43
|
version: "0"
|
36
44
|
type: :development
|
37
45
|
version_requirements: *id002
|
@@ -74,17 +82,21 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
74
82
|
requirements:
|
75
83
|
- - ">="
|
76
84
|
- !ruby/object:Gem::Version
|
85
|
+
segments:
|
86
|
+
- 0
|
77
87
|
version: "0"
|
78
88
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
79
89
|
none: false
|
80
90
|
requirements:
|
81
91
|
- - ">="
|
82
92
|
- !ruby/object:Gem::Version
|
93
|
+
segments:
|
94
|
+
- 0
|
83
95
|
version: "0"
|
84
96
|
requirements: []
|
85
97
|
|
86
98
|
rubyforge_project:
|
87
|
-
rubygems_version: 1.
|
99
|
+
rubygems_version: 1.3.7
|
88
100
|
signing_key:
|
89
101
|
specification_version: 3
|
90
102
|
summary: ActiveRecord enums with i18n
|