File tree Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -177,13 +177,13 @@ en:
177
177
https://docs.mongodb.com/mongoid/current/reference/fields/#custom-field-options"
178
178
invalid_field_type :
179
179
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
181
181
%{type_inspection}. This value is neither present in Mongoid's default type mapping,
182
182
nor defined in a custom field type mapping."
183
183
resolution : " Please provide a valid :type value for the field. If you
184
184
meant to define a custom field type, please do so first as follows:\n\n
185
185
\_\_ Mongoid::Fields.configure do\n
186
- \_\_\_\_ type %{type_inspection}, YourTypeClass
186
+ \_\_\_\_ define_type %{type_inspection}, YourTypeClass
187
187
\_\_ end\n
188
188
\_\_ class %{klass}\n
189
189
\_\_\_\_ include Mongoid::Document\n
Original file line number Diff line number Diff line change 23
23
24
24
it "contains the summary in the message" do
25
25
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."
27
27
)
28
28
end
29
29
end
41
41
42
42
it "contains the summary in the message" do
43
43
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".,
45
45
)
46
46
end
47
47
end
Original file line number Diff line number Diff line change 369
369
it 'raises InvalidFieldType' do
370
370
lambda do
371
371
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/ )
373
373
end
374
374
end
375
375
376
376
context 'when using an unknown string' do
377
377
it 'raises InvalidFieldType' do
378
378
lambda do
379
379
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"/ )
381
381
end
382
382
end
383
383
end
You can’t perform that action at this time.
0 commit comments