lib/mongoid/fields.rb in mongoid-7.0.0.beta vs lib/mongoid/fields.rb in mongoid-7.0.0
- old
+ new
@@ -409,11 +409,11 @@
#
# @since 2.4.0
def create_field_getter(name, meth, field)
generated_methods.module_eval do
re_define_method(meth) do
- raw = read_attribute(name)
+ raw = read_raw_attribute(name)
if lazy_settable?(field, raw)
write_attribute(name, field.eval_default(self))
else
value = field.demongoize(raw)
attribute_will_change!(name) if value.resizable?
@@ -478,10 +478,10 @@
#
# @since 2.4.0
def create_field_check(name, meth)
generated_methods.module_eval do
re_define_method("#{meth}?") do
- value = read_attribute(name)
+ value = read_raw_attribute(name)
lookup_attribute_presence(name, value)
end
end
end