Method: Wgit::Model.select_bson_types

Defined in:
lib/wgit/database/model.rb

.select_bson_types(model_hash) ⇒ Hash

Returns the model having removed non bson types (for use with MongoDB).

Parameters:

  • model_hash (Hash)

    The model Hash to sanitize.

Returns:

  • (Hash)

    The model Hash with non bson types removed.



56
57
58
# File 'lib/wgit/database/model.rb', line 56

def self.select_bson_types(model_hash)
  model_hash.select { |_k, v| v.respond_to?(:bson_type) }
end