Skip to content

Instantly share code, notes, and snippets.

@daz4126
Created August 17, 2012 15:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daz4126/3379955 to your computer and use it in GitHub Desktop.
Save daz4126/3379955 to your computer and use it in GitHub Desktop.
class Riddle
include DataMapper::Resource
property :id, Serial
property :created_at, DateTime
property :updated_at, DateTime
property :title, String
property :html, Text
property :html_engine, String
property :css, Text
property :css_engine, String
property :js, Text
property :js_engine, String
def title=(value)
super(value.empty? ? "Yet another untitled Riddle" : value)
end
end
DataMapper.finalize
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment