This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'bson' | |
module Wikia::Screen | |
# Extensions for mapping to/from BSON. | |
module MongoExtensions | |
def to_bson(obj) | |
obj = obj.dup | |
# Add created and modified dates | |
obj["schema:dateCreated"] = Time.parse(obj["schema:dateCreated"]) if obj.has_key?("schema:dateCreated") |