lib/mongoid/fields/localized.rb in mongoid-4.0.0.alpha2 vs lib/mongoid/fields/localized.rb in mongoid-4.0.0.beta1
- old
+ new
@@ -61,10 +61,10 @@
#
# @since 3.0.0
def lookup(object)
locale = ::I18n.locale
if ::I18n.respond_to?(:fallbacks)
- object[::I18n.fallbacks[locale].map(&:to_s).find{ |loc| object[loc] }]
+ object[::I18n.fallbacks[locale].map(&:to_s).find{ |loc| object.has_key?(loc) }]
else
object[locale.to_s]
end
end
end