Created
January 6, 2010 17:46
-
-
Save wpiekutowski/270454 to your computer and use it in GitHub Desktop.
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 '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