lib/mongoid/fields/localized.rb in mongoid-8.0.8 vs lib/mongoid/fields/localized.rb in mongoid-8.1.0
- old
+ new
@@ -29,9 +29,19 @@
# @return [ true | false ] If the field is localized.
def localized?
true
end
+ # Is the localized field enforcing values to be present?
+ #
+ # @example Is the localized field enforcing values to be present?
+ # field.localize_present?
+ #
+ # @return [ true | false ] If the field enforces present.
+ def localize_present?
+ options[:localize] == :present
+ end
+
# Convert the provided string into a hash for the locale.
#
# @example Serialize the value.
# field.mongoize("testing")
#