Skip to content

Commit

Permalink
Merge 4189c24 into 45dbee4
Browse files Browse the repository at this point in the history
  • Loading branch information
topac committed Jan 16, 2015
2 parents 45dbee4 + 4189c24 commit e223860
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/mongoid/tasks/database.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def undefined_indexes(models = ::Mongoid.models)
model.collection.indexes.each do |index|
# ignore default index
unless index['name'] == '_id_'
key = index['key'].symbolize_keys
key = index['key'].to_h.symbolize_keys
spec = model.index_specification(key)
unless spec
# index not specified
Expand All @@ -72,7 +72,7 @@ def undefined_indexes(models = ::Mongoid.models)
def remove_undefined_indexes(models = ::Mongoid.models)
undefined_indexes(models).each do |model, indexes|
indexes.each do |index|
key = index['key'].symbolize_keys
key = index['key'].to_h.symbolize_keys
model.collection.indexes.drop(key)
logger.info("MONGOID: Removing index: #{index['name']} on #{model}.")
end
Expand Down

0 comments on commit e223860

Please sign in to comment.