Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@asm
Created July 26, 2010 18:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save asm/491043 to your computer and use it in GitHub Desktop.
Save asm/491043 to your computer and use it in GitHub Desktop.
diff --git a/lib/mongo_adapter/adapter.rb b/lib/mongo_adapter/adapter.rb
index 2ae35f8..51e3be3 100644
--- a/lib/mongo_adapter/adapter.rb
+++ b/lib/mongo_adapter/adapter.rb
@@ -5,6 +5,10 @@ module DataMapper
class ConnectionError < StandardError; end
+ def storage_exists?(name)
+ true
+ end
+
# Persists one or more new resources
#
# @example
diff --git a/lib/mongo_adapter/model.rb b/lib/mongo_adapter/model.rb
index 803178a..c05569c 100644
--- a/lib/mongo_adapter/model.rb
+++ b/lib/mongo_adapter/model.rb
@@ -23,9 +23,9 @@ module DataMapper
elsif Hash == type
type = DataMapper::Mongo::Property::Hash
elsif DateTime == type
- type = DataMapper::Mongo::Types::DateTime
+ #type = DataMapper::Mongo::Types::DateTime
elsif Date == type
- type = DataMapper::Mongo::Types::Date
+ #type = DataMapper::Mongo::Types::Date
end
super(name, type, options)
diff --git a/lib/mongo_adapter/support/date_time.rb b/lib/mongo_adapter/support/date_time.rb
index 92ff196..319de8c 100644
--- a/lib/mongo_adapter/support/date_time.rb
+++ b/lib/mongo_adapter/support/date_time.rb
@@ -1,7 +1,7 @@
class DateTime
# @api public
def self.to_mongo(value)
- value.to_time.utc
+ value.utc.to_time
end
# @api public
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment