gettext_activerecord 2.0.1 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/ChangeLog +6 -0
- data/README.rdoc +6 -3
- data/Rakefile +2 -2
- data/data/locale/nl/LC_MESSAGES/gettext_activerecord.mo +0 -0
- data/lib/gettext_activerecord/base.rb +9 -2
- data/lib/gettext_activerecord/parser.rb +2 -5
- data/lib/gettext_activerecord/tools.rb +7 -2
- data/lib/gettext_activerecord/validations.rb +3 -1
- data/lib/gettext_activerecord/version.rb +1 -1
- data/po/nl/gettext_activerecord.po +17 -23
- data/test/Rakefile +1 -1
- data/test/db/sqlite.rb +6 -1
- data/test/helper.rb +5 -1
- data/test/test_validations.rb +16 -26
- metadata +3 -3
data/ChangeLog
CHANGED
data/README.rdoc
CHANGED
@@ -88,6 +88,8 @@ using Ruby-GetText-Package.
|
|
88
88
|
See gettext_rails [http://github.com/mutoh/gettext_rails/tree/master]
|
89
89
|
|
90
90
|
== Support matrix
|
91
|
+
* gettext_activerecord-2.0.2 - rails-2.3.2
|
92
|
+
* gettext_activerecord-2.0.1 - rails-2.3.2
|
91
93
|
* gettext_activerecord-2.0.0 - rails-2.3.2
|
92
94
|
|
93
95
|
== License
|
@@ -107,7 +109,8 @@ This program is licenced under the same licence as Ruby.
|
|
107
109
|
* LIN CHUNG-YI <xmarsh at gmail.com>
|
108
110
|
* Croatian(hr) - Sanjin Sehic <saserr at gmail.com>
|
109
111
|
* Czech(cs) - Karel Miarka <kajism at yahoo.com>
|
110
|
-
* Dutch(nl) -
|
112
|
+
* Dutch(nl) - Bart ten Brinke <info at retrosync.com> (current)
|
113
|
+
Menno Jonkers <ruby-gettext at jonkers.com>
|
111
114
|
* Esperanto(eo) - Malte Milatz <malte at gmx-topmail.de>
|
112
115
|
* Estonian(et) - Erkki Eilonen <erkki at itech.ee>
|
113
116
|
* French(fr)
|
@@ -148,7 +151,7 @@ This program is licenced under the same licence as Ruby.
|
|
148
151
|
* Chinese(zh_CN) - 2.0.0
|
149
152
|
* Chinese(zh_TW) - 2.0.0
|
150
153
|
* Czech(cs) - 1.9.0 (old)
|
151
|
-
* Dutch(nl) -
|
154
|
+
* Dutch(nl) - 2.0.2
|
152
155
|
* English(default) - 1.90.0 (old)
|
153
156
|
* Esperanto(eo) - 2.0.0
|
154
157
|
* Estonian(et) - 2.0.0
|
@@ -157,7 +160,7 @@ This program is licenced under the same licence as Ruby.
|
|
157
160
|
* Greek(el) - 2.0.0
|
158
161
|
* Hungarian(hu) - 2.0.0
|
159
162
|
* Italian(it) - 1.6.0 (old)
|
160
|
-
* Japanese(ja) - 2.0.
|
163
|
+
* Japanese(ja) - 2.0.2
|
161
164
|
* Korean(ko) - 1.9.0 (old)
|
162
165
|
* Latvian(lv) - 2.0.0
|
163
166
|
* Norwegian(nb) - 2.0.0
|
data/Rakefile
CHANGED
@@ -64,7 +64,7 @@ spec = Gem::Specification.new do |s|
|
|
64
64
|
s.rubyforge_project = "gettext"
|
65
65
|
s.files = FileList['**/*'].to_a.select{|v| v !~ /pkg|git/}
|
66
66
|
s.require_path = 'lib'
|
67
|
-
s.add_dependency('gettext', '>= 2.0.
|
67
|
+
s.add_dependency('gettext', '>= 2.0.2')
|
68
68
|
s.add_dependency('activerecord', '>= 2.3.2')
|
69
69
|
s.has_rdoc = true
|
70
70
|
s.description = 'Localization support for ActiveRecord by Ruby-GetText-Package.'
|
@@ -97,7 +97,7 @@ Rake::RDocTask.new { |rdoc|
|
|
97
97
|
}
|
98
98
|
|
99
99
|
desc "Publish the release files to RubyForge."
|
100
|
-
task :release => [
|
100
|
+
task :release => [ :package ] do
|
101
101
|
require 'rubyforge'
|
102
102
|
|
103
103
|
rubyforge = RubyForge.new
|
Binary file
|
@@ -19,6 +19,10 @@ module ActiveRecord #:nodoc:
|
|
19
19
|
|
20
20
|
class << self
|
21
21
|
# Untranslate all of the tablename/fieldnames in this model class.
|
22
|
+
# (e.g.)
|
23
|
+
# Person < ActiveRecord::Base
|
24
|
+
# untranslate_all
|
25
|
+
# end
|
22
26
|
def untranslate_all
|
23
27
|
@@gettext_untranslate[self] = true
|
24
28
|
end
|
@@ -29,7 +33,10 @@ module ActiveRecord #:nodoc:
|
|
29
33
|
end
|
30
34
|
|
31
35
|
# Sets the untranslate columns.
|
32
|
-
#
|
36
|
+
# (e.g.)
|
37
|
+
# Person < ActiveRecord::Base
|
38
|
+
# untranslate :age, :address
|
39
|
+
# end
|
33
40
|
def untranslate(*w)
|
34
41
|
ary = @@gettext_untranslate_columns[self] || []
|
35
42
|
ary += w.collect{|v| v.to_s}
|
@@ -37,7 +44,7 @@ module ActiveRecord #:nodoc:
|
|
37
44
|
end
|
38
45
|
|
39
46
|
# Returns true if the column is set "untranslate".
|
40
|
-
#
|
47
|
+
# (e.g.) untranslate? :foo
|
41
48
|
def untranslate?(columnname)
|
42
49
|
ary = @@gettext_untranslate_columns[self] || []
|
43
50
|
ary.include?(columnname)
|
@@ -18,8 +18,6 @@ include GetText
|
|
18
18
|
ActiveRecord::Base.instance_eval do
|
19
19
|
alias inherited_without_log inherited
|
20
20
|
|
21
|
-
@@active_record_classes_list = []
|
22
|
-
|
23
21
|
def inherited(subclass)
|
24
22
|
puts "registering an ActiveRecord model for later processing: #{subclass}" if $DEBUG
|
25
23
|
active_record_classes_list << "#{subclass}" unless subclass.name.empty?
|
@@ -27,11 +25,11 @@ ActiveRecord::Base.instance_eval do
|
|
27
25
|
end
|
28
26
|
|
29
27
|
def active_record_classes_list
|
30
|
-
|
28
|
+
$active_record_classes_list ||= []
|
31
29
|
end
|
32
30
|
|
33
31
|
def reset_active_record_classes_list
|
34
|
-
|
32
|
+
$active_record_classes_list = []
|
35
33
|
end
|
36
34
|
end
|
37
35
|
|
@@ -187,7 +185,6 @@ module GetText
|
|
187
185
|
gem 'activerecord'
|
188
186
|
require_rails 'activesupport'
|
189
187
|
require_rails 'active_record'
|
190
|
-
require_rails 'activesupport'
|
191
188
|
require_rails 'gettext_activerecord'
|
192
189
|
end
|
193
190
|
begin
|
@@ -14,9 +14,14 @@ require 'gettext_activerecord/parser'
|
|
14
14
|
module GetText
|
15
15
|
extend self
|
16
16
|
|
17
|
-
alias :create_mofiles_org :create_mofiles
|
18
|
-
alias :update_pofiles_org :update_pofiles
|
17
|
+
alias :create_mofiles_org :create_mofiles #:nodoc:
|
18
|
+
alias :update_pofiles_org :update_pofiles #:nodoc:
|
19
19
|
|
20
|
+
# update_pofiles for ActiveRecord.
|
21
|
+
# In this method, GetText::ActiveRecordParser.init is called
|
22
|
+
# with "options".
|
23
|
+
# (e.g.)
|
24
|
+
# GetText.update_po_files("foo", Dir.glob("lib/**/*"), "1.0.0", :untranslate_classes = ["UntranslateClass"]
|
20
25
|
def update_pofiles(textdomain, files, app_version, options = {})
|
21
26
|
GetText::ActiveRecordParser.init(options)
|
22
27
|
GetText.update_pofiles_org(textdomain, files, app_version, options)
|
@@ -156,7 +156,9 @@ module ActiveRecord #:nodoc:
|
|
156
156
|
symbol = obj[:default][0].to_s.split(".").last.to_sym
|
157
157
|
msgid = @@default_error_messages[symbol]
|
158
158
|
end
|
159
|
-
attr, count, value = obj[:attribute], obj[:count], obj[:value]
|
159
|
+
#attr, count, value = obj[:attribute], obj[:count], obj[:value]
|
160
|
+
count, value = obj[:count], obj[:value]
|
161
|
+
attr = obj[:attribute] if obj[:attribute]
|
160
162
|
end
|
161
163
|
msgstr = @base.gettext(msgid)
|
162
164
|
msgstr = _(msgid) if msgstr == msgid
|
@@ -5,6 +5,7 @@
|
|
5
5
|
#
|
6
6
|
# This file is distributed under the same license as the Ruby-GetText-Package.
|
7
7
|
#
|
8
|
+
# Bart ten Brinke <info at retrosync.com>, 2009.
|
8
9
|
# Menno Jonkers <ruby-gettext at jonkers.com>, 2005-2007.
|
9
10
|
#
|
10
11
|
msgid ""
|
@@ -12,8 +13,8 @@ msgstr ""
|
|
12
13
|
"Project-Id-Version: gettext_activerecord 0.1.0\n"
|
13
14
|
"POT-Creation-Date: 2009-02-09 01:48+0900\n"
|
14
15
|
"PO-Revision-Date: 2007-06-26 20:52+0100\n"
|
15
|
-
"Last-Translator:
|
16
|
-
"Language-Team: Dutch <
|
16
|
+
"Last-Translator: Bart ten Brinke <info at retrosync.com>\n"
|
17
|
+
"Language-Team: Dutch <info at retrosync.com>\n"
|
17
18
|
"MIME-Version: 1.0\n"
|
18
19
|
"Content-Type: text/plain; charset=UTF-8\n"
|
19
20
|
"Content-Transfer-Encoding: 8bit\n"
|
@@ -21,19 +22,19 @@ msgstr ""
|
|
21
22
|
|
22
23
|
#: lib/gettext_activerecord/parser.rb:60
|
23
24
|
msgid "'%{file}' is not found."
|
24
|
-
msgstr ""
|
25
|
+
msgstr "Kan het bestand '%{file}' niet vinden."
|
25
26
|
|
26
27
|
#: lib/gettext_activerecord/parser.rb:104
|
27
28
|
msgid "Ignored '%{file}'. Solve dependencies first."
|
28
|
-
msgstr ""
|
29
|
+
msgstr "Bestand '%{file}' wordt overgeslagen. Dependency probleem."
|
29
30
|
|
30
31
|
#: lib/gettext_activerecord/parser.rb:131
|
31
32
|
msgid "No database is available."
|
32
|
-
msgstr ""
|
33
|
+
msgstr "Er is geen database beschikbaar."
|
33
34
|
|
34
35
|
#: lib/gettext_activerecord/parser.rb:167
|
35
36
|
msgid "rubygems are not found."
|
36
|
-
msgstr ""
|
37
|
+
msgstr "Kan rubygems niet vinden."
|
37
38
|
|
38
39
|
#: lib/gettext_activerecord/active_record.rb:27
|
39
40
|
msgid "Validation failed: %{error_messages}"
|
@@ -45,7 +46,7 @@ msgstr "%{attribute} komt niet voor in de lijst"
|
|
45
46
|
|
46
47
|
#: lib/gettext_activerecord/active_record.rb:219
|
47
48
|
msgid "%{attribute} is reserved"
|
48
|
-
msgstr "%{attribute}
|
49
|
+
msgstr "%{attribute} mag niet worden gebruikt"
|
49
50
|
|
50
51
|
#: lib/gettext_activerecord/active_record.rb:220
|
51
52
|
msgid "%{attribute} is invalid"
|
@@ -69,11 +70,11 @@ msgstr "%{attribute} mag niet leeg zijn"
|
|
69
70
|
|
70
71
|
#: lib/gettext_activerecord/active_record.rb:225
|
71
72
|
msgid "%{attribute} is too long (maximum is %{count} characters)"
|
72
|
-
msgstr "%{attribute} is te lang (
|
73
|
+
msgstr "%{attribute} is te lang (maximaal %{count} tekens)"
|
73
74
|
|
74
75
|
#: lib/gettext_activerecord/active_record.rb:226
|
75
76
|
msgid "%{attribute} is too short (minimum is %{count} characters)"
|
76
|
-
msgstr "%{attribute} is te kort (
|
77
|
+
msgstr "%{attribute} is te kort (minimaal %{count} tekens)"
|
77
78
|
|
78
79
|
#: lib/gettext_activerecord/active_record.rb:227
|
79
80
|
msgid "%{attribute} is the wrong length (should be %{count} characters)"
|
@@ -88,36 +89,29 @@ msgid "%{attribute} is not a number"
|
|
88
89
|
msgstr "%{attribute} is geen getal"
|
89
90
|
|
90
91
|
#: lib/gettext_activerecord/active_record.rb:230
|
91
|
-
#, fuzzy
|
92
92
|
msgid "%{attribute} must be greater than %{count}"
|
93
|
-
msgstr "%{attribute} moet
|
93
|
+
msgstr "%{attribute} moet groter zijn dan %{count}"
|
94
94
|
|
95
95
|
#: lib/gettext_activerecord/active_record.rb:231
|
96
|
-
#, fuzzy
|
97
96
|
msgid "%{attribute} must be greater than or equal to %{count}"
|
98
|
-
msgstr "%{attribute} moet
|
97
|
+
msgstr "%{attribute} moet groter of gelijk zijn aan %{count}"
|
99
98
|
|
100
99
|
#: lib/gettext_activerecord/active_record.rb:232
|
101
|
-
#, fuzzy
|
102
100
|
msgid "%{attribute} must be equal to %{count}"
|
103
|
-
msgstr "%{attribute} moet
|
101
|
+
msgstr "%{attribute} moet gelijk zijn aan %{count}"
|
104
102
|
|
105
103
|
#: lib/gettext_activerecord/active_record.rb:233
|
106
|
-
#, fuzzy
|
107
104
|
msgid "%{attribute} must be less than %{count}"
|
108
|
-
msgstr "%{attribute} moet
|
105
|
+
msgstr "%{attribute} moet minder zijn dan %{count}"
|
109
106
|
|
110
107
|
#: lib/gettext_activerecord/active_record.rb:234
|
111
|
-
#, fuzzy
|
112
108
|
msgid "%{attribute} must be less than or equal to %{count}"
|
113
|
-
msgstr "%{attribute} moet
|
109
|
+
msgstr "%{attribute} moet minder dan of gelijk zijn aan %{count}"
|
114
110
|
|
115
111
|
#: lib/gettext_activerecord/active_record.rb:235
|
116
|
-
#, fuzzy
|
117
112
|
msgid "%{attribute} must be odd"
|
118
|
-
msgstr "%{attribute} moet
|
113
|
+
msgstr "%{attribute} moet een oneven aantal zijn"
|
119
114
|
|
120
115
|
#: lib/gettext_activerecord/active_record.rb:236
|
121
|
-
#, fuzzy
|
122
116
|
msgid "%{attribute} must be even"
|
123
|
-
msgstr "%{attribute} moet
|
117
|
+
msgstr "%{attribute} moet even aantal zijn"
|
data/test/Rakefile
CHANGED
data/test/db/sqlite.rb
CHANGED
@@ -1,6 +1,11 @@
|
|
1
1
|
#create a connection
|
2
|
+
if /java/ =~ RUBY_PLATFORM
|
3
|
+
adapter = "jdbcsqlite3"
|
4
|
+
else
|
5
|
+
adapter = "sqlite3"
|
6
|
+
end
|
2
7
|
ActiveRecord::Base.configurations = {"test" => {
|
3
|
-
:adapter =>
|
8
|
+
:adapter => adapter,
|
4
9
|
:database => ":memory:"
|
5
10
|
}.with_indifferent_access}
|
6
11
|
|
data/test/helper.rb
CHANGED
data/test/test_validations.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# encoding: utf-8
|
1
2
|
require 'helper'
|
2
3
|
|
3
4
|
require 'models/topic'
|
@@ -108,11 +109,11 @@ class ValidationsTest < ActiveRecord::TestCase
|
|
108
109
|
assert !r.save
|
109
110
|
|
110
111
|
assert r.errors.invalid?("title"), "A reply without title should mark that attribute as invalid"
|
111
|
-
assert_equal "Replyタイトル 空です。", r.errors.full_messages
|
112
|
+
assert_equal ["Replyタイトル 空です。", "Reply内容 空です。"].sort, r.errors.full_messages.sort
|
112
113
|
assert_equal "空です。", r.errors.on("title")
|
113
114
|
|
114
115
|
assert r.errors.invalid?("content"), "A reply without content should mark that attribute as invalid"
|
115
|
-
assert_equal "Reply内容 空です。", r.errors.full_messages
|
116
|
+
assert_equal ["Replyタイトル 空です。", "Reply内容 空です。"].sort, r.errors.full_messages.sort
|
116
117
|
assert_equal "空です。", r.errors.on("content")
|
117
118
|
|
118
119
|
assert_equal 2, r.errors.count
|
@@ -122,11 +123,11 @@ class ValidationsTest < ActiveRecord::TestCase
|
|
122
123
|
assert !r.save
|
123
124
|
|
124
125
|
assert r.errors.invalid?("title"), "A reply without title should mark that attribute as invalid"
|
125
|
-
assert_equal "Title Empty", r.errors.full_messages
|
126
|
+
assert_equal ["Content Empty", "Title Empty"], r.errors.full_messages.sort
|
126
127
|
assert_equal "Empty", r.errors.on("title"), "A reply without title should contain an error"
|
127
128
|
|
128
129
|
assert r.errors.invalid?("content"), "A reply without content should mark that attribute as invalid"
|
129
|
-
assert_equal "Content Empty", r.errors.full_messages
|
130
|
+
assert_equal ["Content Empty", "Title Empty"], r.errors.full_messages.sort
|
130
131
|
assert_equal "Empty", r.errors.on("content"), "A reply without content should contain an error"
|
131
132
|
|
132
133
|
assert_equal 2, r.errors.count
|
@@ -138,7 +139,7 @@ class ValidationsTest < ActiveRecord::TestCase
|
|
138
139
|
r.title = "Wrong Create"
|
139
140
|
assert !r.save
|
140
141
|
assert r.errors.invalid?("title"), "A reply with a bad title should mark that attribute as invalid"
|
141
|
-
assert_equal "Replyタイトル が不正に生成されました。", r.errors.full_messages
|
142
|
+
assert_equal ["Replyタイトル が不正に生成されました。", "Reply内容 空です。"], r.errors.full_messages.sort
|
142
143
|
assert_equal "が不正に生成されました。", r.errors.on("title")
|
143
144
|
|
144
145
|
GetText.set_locale "en"
|
@@ -146,7 +147,7 @@ class ValidationsTest < ActiveRecord::TestCase
|
|
146
147
|
r.title = "Wrong Create"
|
147
148
|
assert !r.save
|
148
149
|
assert r.errors.invalid?("title"), "A reply with a bad title should mark that attribute as invalid"
|
149
|
-
assert_equal "Title is Wrong Create", r.errors.full_messages
|
150
|
+
assert_equal ["Content Empty", "Title is Wrong Create"], r.errors.full_messages.sort
|
150
151
|
assert_equal "is Wrong Create", r.errors.on("title")
|
151
152
|
end
|
152
153
|
|
@@ -188,7 +189,7 @@ class ValidationsTest < ActiveRecord::TestCase
|
|
188
189
|
flunk
|
189
190
|
rescue ActiveRecord::RecordInvalid => invalid
|
190
191
|
assert_equal r, invalid.record
|
191
|
-
|
192
|
+
assert ["入力値が正しくありません。: Replyタイトル 空です。, Reply内容 空です。", "入力値が正しくありません。: Reply内容 空です。, Replyタイトル 空です。"].include? invalid.message
|
192
193
|
end
|
193
194
|
|
194
195
|
GetText.set_locale "en"
|
@@ -198,7 +199,7 @@ class ValidationsTest < ActiveRecord::TestCase
|
|
198
199
|
flunk
|
199
200
|
rescue ActiveRecord::RecordInvalid => invalid
|
200
201
|
assert_equal r, invalid.record
|
201
|
-
|
202
|
+
assert ["Validation failed: Title Empty, Content Empty", "Validation failed: Content Empty, Title Empty"].include? invalid.message
|
202
203
|
end
|
203
204
|
end
|
204
205
|
|
@@ -283,7 +284,7 @@ class ValidationsTest < ActiveRecord::TestCase
|
|
283
284
|
begin
|
284
285
|
Reply.create!
|
285
286
|
rescue ActiveRecord::RecordInvalid => invalid
|
286
|
-
|
287
|
+
assert ["入力値が正しくありません。: Replyタイトル 空です。, Reply内容 空です。", "入力値が正しくありません。: Reply内容 空です。, Replyタイトル 空です。"].include? invalid.message
|
287
288
|
end
|
288
289
|
end
|
289
290
|
|
@@ -292,7 +293,7 @@ class ValidationsTest < ActiveRecord::TestCase
|
|
292
293
|
begin
|
293
294
|
Reply.create!
|
294
295
|
rescue ActiveRecord::RecordInvalid => invalid
|
295
|
-
|
296
|
+
assert ["Validation failed: Title Empty, Content Empty", "Validation failed: Content Empty, Title Empty"].include? invalid.message
|
296
297
|
end
|
297
298
|
end
|
298
299
|
end
|
@@ -2360,42 +2361,31 @@ class ValidationsTest < ActiveRecord::TestCase
|
|
2360
2361
|
GetText.set_locale "ja_JP.UTF-8"
|
2361
2362
|
t = Topic.create
|
2362
2363
|
assert !t.save
|
2363
|
-
assert_equal "タイトルを入力してください。", t.errors.full_messages
|
2364
|
-
assert_equal "内容を入力してください。", t.errors.full_messages[1]
|
2364
|
+
assert_equal ["タイトルを入力してください。", "内容を入力してください。"].sort, t.errors.full_messages.sort
|
2365
2365
|
assert_equal "タイトルを入力してください。", t.errors.on(:title)
|
2366
2366
|
assert_equal "内容を入力してください。", t.errors.on(:content)
|
2367
2367
|
|
2368
2368
|
t = Reply.create
|
2369
2369
|
assert !t.save
|
2370
|
-
assert_equal "Replyタイトルを入力してください。", t.errors.full_messages
|
2371
|
-
assert_equal "Replyタイトル 空です。", t.errors.full_messages[1]
|
2372
|
-
assert_equal "Reply内容を入力してください。", t.errors.full_messages[2]
|
2373
|
-
assert_equal "Reply内容 空です。", t.errors.full_messages[3]
|
2370
|
+
assert_equal ["Replyタイトルを入力してください。", "Replyタイトル 空です。", "Reply内容を入力してください。", "Reply内容 空です。"].sort, t.errors.full_messages.sort
|
2374
2371
|
assert_equal ["Replyタイトルを入力してください。","空です。"], t.errors.on(:title)
|
2375
2372
|
assert_equal ["Reply内容を入力してください。", "空です。"], t.errors.on(:content)
|
2376
2373
|
|
2377
2374
|
t = Reply.create
|
2378
2375
|
t.title = "Wrong Create"
|
2379
2376
|
assert !t.save
|
2380
|
-
assert_equal "Replyタイトル が不正に生成されました。", t.errors.full_messages
|
2381
|
-
assert_equal "Reply内容を入力してください。", t.errors.full_messages[1]
|
2382
|
-
assert_equal "Reply内容 空です。", t.errors.full_messages[2]
|
2377
|
+
assert_equal ["Replyタイトル が不正に生成されました。", "Reply内容を入力してください。", "Reply内容 空です。"].sort, t.errors.full_messages.sort
|
2383
2378
|
|
2384
2379
|
t = SillyReply.create
|
2385
2380
|
assert !t.save
|
2386
|
-
assert_equal "Sillyタイトルを入力してください。", t.errors.full_messages
|
2387
|
-
assert_equal "Sillyタイトル 空です。", t.errors.full_messages[1]
|
2388
|
-
assert_equal "Silly内容を入力してください。", t.errors.full_messages[2]
|
2389
|
-
assert_equal "Silly内容 空です。", t.errors.full_messages[3]
|
2381
|
+
assert_equal ["Sillyタイトルを入力してください。", "Sillyタイトル 空です。", "Silly内容を入力してください。", "Silly内容 空です。"].sort, t.errors.full_messages.sort
|
2390
2382
|
assert_equal ["Sillyタイトルを入力してください。","空です。"], t.errors.on(:title)
|
2391
2383
|
assert_equal ["Silly内容を入力してください。","空です。"], t.errors.on(:content)
|
2392
2384
|
|
2393
2385
|
t = SillyReply.create
|
2394
2386
|
t.title = "Wrong Create"
|
2395
2387
|
assert !t.save
|
2396
|
-
assert_equal "Sillyタイトル が不正に生成されました。", t.errors.full_messages
|
2397
|
-
assert_equal "Silly内容を入力してください。", t.errors.full_messages[1]
|
2398
|
-
assert_equal "Silly内容 空です。", t.errors.full_messages[2]
|
2388
|
+
assert_equal ["Sillyタイトル が不正に生成されました。", "Silly内容を入力してください。", "Silly内容 空です。"].sort, t.errors.full_messages.sort
|
2399
2389
|
end
|
2400
2390
|
|
2401
2391
|
def test_original_model_with_validation
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gettext_activerecord
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Masao Mutoh
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-05-09 00:00:00 +09:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -20,7 +20,7 @@ dependencies:
|
|
20
20
|
requirements:
|
21
21
|
- - ">="
|
22
22
|
- !ruby/object:Gem::Version
|
23
|
-
version: 2.0.
|
23
|
+
version: 2.0.2
|
24
24
|
version:
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: activerecord
|