File tree Expand file tree Collapse file tree 2 files changed +0
-32
lines changed Expand file tree Collapse file tree 2 files changed +0
-32
lines changed Original file line number Diff line number Diff line change @@ -127,15 +127,6 @@ def mongoize
127
127
self
128
128
end
129
129
130
- # Mongoize the given value and return nil if an error is raised.
131
- #
132
- # @return [ Object ] The object.
133
- #
134
- # @api private
135
- def mongoize_safe
136
- mongoize rescue nil
137
- end
138
-
139
130
# Is the object multi args.
140
131
#
141
132
# @example Is the object multi args?
@@ -249,17 +240,6 @@ def mongoize(object)
249
240
object . mongoize
250
241
end
251
242
252
- # Mongoize the given value and return nil if an error is raised.
253
- #
254
- # @param [ Object ] object The object to mongoize.
255
- #
256
- # @return [ Object ] The object mongoized.
257
- #
258
- # @api private
259
- def mongoize_safe ( object )
260
- mongoize ( object ) rescue nil
261
- end
262
-
263
243
def _mongoid_wrap_mongoize ( object )
264
244
return if object . nil?
265
245
yield . tap do |res |
Original file line number Diff line number Diff line change 16
16
end . to raise_error ( Mongoid ::Errors ::InvalidValue )
17
17
end
18
18
end
19
-
20
- context "to mongoize_safe" do
21
- it "return nil" do
22
- expect ( klass . mongoize_safe ( invalid_value ) ) . to be_nil
23
- end
24
- end
25
19
end
26
20
27
21
context "when assigning an invalid value to a field" do
60
54
expect ( klass . mongoize ( invalid_value ) ) . to eq ( mongoized_value )
61
55
end
62
56
end
63
-
64
- context "to mongoize_safe" do
65
- it "returns that value" do
66
- expect ( klass . mongoize_safe ( invalid_value ) ) . to eq ( mongoized_value )
67
- end
68
- end
69
57
end
70
58
71
59
context "when assigning an invalid value to a field" do
You can’t perform that action at this time.
0 commit comments