Skip to content

Instantly share code, notes, and snippets.

@erik-megarad
Created December 29, 2009 08:26
Show Gist options
  • Save erik-megarad/265216 to your computer and use it in GitHub Desktop.
Save erik-megarad/265216 to your computer and use it in GitHub Desktop.
# FUCK NO
class Person
include Mongoid::Document
field :athing, :type => String, :default => "Something"
validates_format_of :athing, :with => /[A-Za-z]/
end
# HELL YES
class Person
include Mongoid::Document
string :athing do
default "Someting"
format /[A-Za-z]/
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment