Skip to content

Commit c304589

Browse files
johnnyshieldsjamis
andauthored
MONGOID-5667 [Monkey Patch Removal] Remove String/Integer#unconvertable_to_bson? (#5704)
* Remove String#unconvertable_to_bson? and Integer#unconvertable_to_bson? * Remove one more usage * MONGOID-5667 deprecate instead of remove --------- Co-authored-by: Jamis Buck <[email protected]>
1 parent f99e917 commit c304589

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

lib/mongoid/extensions/integer.rb

+2
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,11 @@ def numeric?
3333
# object.unconvertable_to_bson?
3434
#
3535
# @return [ true ] If the object is unconvertable.
36+
# @deprecated
3637
def unconvertable_to_bson?
3738
true
3839
end
40+
Mongoid.deprecate(self, :unconvertable_to_bson?)
3941

4042
module ClassMethods
4143

lib/mongoid/extensions/string.rb

+5
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ module Extensions
88
module String
99

1010
# @attribute [rw] unconvertable_to_bson If the document is unconvertable.
11+
# @deprecated
1112
attr_accessor :unconvertable_to_bson
13+
Mongoid.deprecate(self, :unconvertable_to_bson, :unconvertable_to_bson=)
1214

1315
# Evolve the string into an object id if possible.
1416
#
@@ -126,15 +128,18 @@ def before_type_cast?
126128
ends_with?("_before_type_cast")
127129
end
128130

131+
129132
# Is the object not to be converted to bson on criteria creation?
130133
#
131134
# @example Is the object unconvertable?
132135
# object.unconvertable_to_bson?
133136
#
134137
# @return [ true | false ] If the object is unconvertable.
138+
# @deprecated
135139
def unconvertable_to_bson?
136140
@unconvertable_to_bson ||= false
137141
end
142+
Mongoid.deprecate(self, :unconvertable_to_bson?)
138143

139144
private
140145

0 commit comments

Comments
 (0)