Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
default name: "Chuck Norris"
class User
include DataMapper::Resource
# PROPERTIES
property :id, Serial
property :fullname, String, :default => "Chuck Norris"
property :password, String
property :created_at, DateTime
property :updated_at, DateTime
validates_presence_of :password, :unless => :fullname == "Chuck Norris" #BECAUSE CHUCK NORRIS DOESN'T NEED A PASSWORD
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment