Skip to content

Instantly share code, notes, and snippets.

@wpiekutowski
Created January 6, 2010 17:46
Show Gist options
  • Save wpiekutowski/270454 to your computer and use it in GitHub Desktop.
Save wpiekutowski/270454 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'mongo_mapper'
require 'pp'
class Person
include MongoMapper::Document
key :name, String, :default => 'John Doe'
end
p = Person.new
pp p # name is 'John Doe' - as exptected
p.name = nil
pp p # name is still 'John Doe' - shouldn't it be nil?
p.name = '' # name is '' - as exptected
pp p
p.name = 'Adam'
pp p # name is 'Adam' - as exptected
p.name = nil
pp p # name is 'John Doe' - shouldn't it be nil?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment