phony_rails 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
data/README.md
CHANGED
data/lib/phony_rails/version.rb
CHANGED
data/lib/phony_rails.rb
CHANGED
@@ -50,7 +50,7 @@ module PhonyRails
|
|
50
50
|
attributes.each do |attribute|
|
51
51
|
attribute_name = options[:as] || attribute
|
52
52
|
raise RuntimeError, "No attribute #{attribute_name} found on #{self.class.name} (PhonyRails)" if not self.class.attribute_method?(attribute_name)
|
53
|
-
|
53
|
+
self.send("#{attribute_name}=", PhonyRails.normalize_number(self.send(attribute), options))
|
54
54
|
end
|
55
55
|
end
|
56
56
|
end
|
@@ -111,7 +111,7 @@ describe PhonyPlausibleValidator do
|
|
111
111
|
@home.errors.messages.should include(:phone_number => ["is an invalid number"])
|
112
112
|
end
|
113
113
|
|
114
|
-
it "should translate the error message in
|
114
|
+
it "should translate the error message in English" do
|
115
115
|
I18n.with_locale(:en) do
|
116
116
|
@home.phone_number = INVALID_NUMBER
|
117
117
|
@home.valid?
|
@@ -119,7 +119,7 @@ describe PhonyPlausibleValidator do
|
|
119
119
|
end
|
120
120
|
end
|
121
121
|
|
122
|
-
it "should translate the error message in
|
122
|
+
it "should translate the error message in French" do
|
123
123
|
I18n.with_locale(:fr) do
|
124
124
|
@home.phone_number = INVALID_NUMBER
|
125
125
|
@home.valid?
|
@@ -127,6 +127,13 @@ describe PhonyPlausibleValidator do
|
|
127
127
|
end
|
128
128
|
end
|
129
129
|
|
130
|
+
it "should translate the error message in Japanese" do
|
131
|
+
I18n.with_locale(:ja) do
|
132
|
+
@home.phone_number = INVALID_NUMBER
|
133
|
+
@home.valid?
|
134
|
+
@home.errors.messages.should include(:phone_number => ["は正し電話番号ではありません"])
|
135
|
+
end
|
136
|
+
end
|
130
137
|
end
|
131
138
|
end
|
132
139
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: phony_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-08-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: phony
|
@@ -110,6 +110,7 @@ files:
|
|
110
110
|
- lib/phony_rails.rb
|
111
111
|
- lib/phony_rails/locales/en.yml
|
112
112
|
- lib/phony_rails/locales/fr.yml
|
113
|
+
- lib/phony_rails/locales/ja.yml
|
113
114
|
- lib/phony_rails/string_extensions.rb
|
114
115
|
- lib/phony_rails/version.rb
|
115
116
|
- lib/validators/phony_validator.rb
|