I hereby claim:
- I am mtkd on github.
- I am mtkd (https://keybase.io/mtkd) on keybase.
- I have a public key whose fingerprint is 3B14 B113 0FDD 8519 4F62 3356 C531 D614 ABF8 DE15
To claim this, I am signing this object:
# not obvious from the database_cleaner documentation | |
# this is snippets of relevant parts, it's not meant to run | |
require 'mongo' | |
require 'database_cleaner' | |
require 'database_cleaner/mongo/base' | |
include Mongo | |
@mongo_client = MongoClient.new |
I hereby claim:
To claim this, I am signing this object:
# without new_record set it silently doesn't save | |
new_document = Marshal.load(Marshal.dump(self)) | |
new_document._id = Moped::BSON::ObjectId.new | |
new_document.new_record = true | |
new_document.save |
# Test to see how much time checking super defined costs (approx 10%) | |
require 'benchmark' | |
class Base | |
def meth; end | |
end | |
class WithSuperCheck < Base | |
def meth; super if defined?(super); end |