Skip to content

Commit f52ed5e

Browse files
committed
Fixes to error text
1 parent f33417a commit f52ed5e

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

lib/config/locales/en.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,13 +177,13 @@ en:
177177
https://docs.mongodb.com/mongoid/current/reference/fields/#custom-field-options"
178178
invalid_field_type:
179179
message: "Invalid field type %{type_inspection} for field '%{field}' on model '%{klass}'."
180-
summary: "Model '%{klass}' defines a field '%{field}' with an unknown :type value
180+
summary: "Model '%{klass}' declares a field '%{field}' with an unknown :type value
181181
%{type_inspection}. This value is neither present in Mongoid's default type mapping,
182182
nor defined in a custom field type mapping."
183183
resolution: "Please provide a valid :type value for the field. If you
184184
meant to define a custom field type, please do so first as follows:\n\n
185185
\_\_Mongoid::Fields.configure do\n
186-
\_\_\_\_type %{type_inspection}, YourTypeClass
186+
\_\_\_\_define_type %{type_inspection}, YourTypeClass
187187
\_\_end\n
188188
\_\_class %{klass}\n
189189
\_\_\_\_include Mongoid::Document\n

spec/mongoid/errors/invalid_field_type_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
it "contains the summary in the message" do
2525
expect(error.message).to include(
26-
"Model 'Person' defines a field 'first_name' with an unknown :type value :stringgy."
26+
"Model 'Person' declares a field 'first_name' with an unknown :type value :stringgy."
2727
)
2828
end
2929
end
@@ -41,7 +41,7 @@
4141

4242
it "contains the summary in the message" do
4343
expect(error.message).to include(
44-
%q,Model 'Person' defines a field 'first_name' with an unknown :type value "stringgy".,
44+
%q,Model 'Person' declares a field 'first_name' with an unknown :type value "stringgy".,
4545
)
4646
end
4747
end

spec/mongoid/fields_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -369,15 +369,15 @@
369369
it 'raises InvalidFieldType' do
370370
lambda do
371371
klass.field(:test, type: :bogus)
372-
end.should raise_error(Mongoid::Errors::InvalidFieldType, /defines a field :test with an unknown :type value :bogus/)
372+
end.should raise_error(Mongoid::Errors::InvalidFieldType, /declares a field 'test' with an unknown :type value :bogus/)
373373
end
374374
end
375375

376376
context 'when using an unknown string' do
377377
it 'raises InvalidFieldType' do
378378
lambda do
379379
klass.field(:test, type: 'bogus')
380-
end.should raise_error(Mongoid::Errors::InvalidFieldType, /defines a field :test with an unknown :type value "bogus"/)
380+
end.should raise_error(Mongoid::Errors::InvalidFieldType, /declares a field 'test' with an unknown :type value "bogus"/)
381381
end
382382
end
383383
end

0 commit comments

Comments
 (0)