@@ -377,7 +377,8 @@ def last(opts = {})
377
377
end
378
378
end
379
379
380
- # Get's the number of documents matching the query selector.
380
+ # Returns the number of documents in the database matching
381
+ # the query selector.
381
382
#
382
383
# @example Get the length.
383
384
# context.length
@@ -832,7 +833,6 @@ def fetch_and_demongoize(obj, meth, field)
832
833
def extract_value ( attrs , field_name )
833
834
i = 1
834
835
num_meths = field_name . count ( '.' ) + 1
835
- k = klass
836
836
curr = attrs . dup
837
837
838
838
klass . traverse_association_tree ( field_name ) do |meth , obj , is_field |
@@ -870,10 +870,6 @@ def extract_value(attrs, field_name)
870
870
fetch_and_demongoize ( curr , meth , field )
871
871
end
872
872
873
- # If it's a relation, update the current klass with the relation klass.
874
- if !is_field && !obj . nil?
875
- k = obj . klass
876
- end
877
873
i += 1
878
874
end
879
875
curr
@@ -910,7 +906,7 @@ def demongoize_with_field(field, value, is_translation)
910
906
# again, we already have the translation. If it's an _translations
911
907
# field, don't demongoize, we want the full hash not just a
912
908
# specific translation.
913
- # If it is a hash, and it's not a transaltions field, we need to
909
+ # If it is a hash, and it's not a translations field, we need to
914
910
# demongoize to get the correct translation.
915
911
if field . localized? && ( !value . is_a? ( Hash ) || is_translation )
916
912
value . class . demongoize ( value )
0 commit comments