Skip to content

Instantly share code, notes, and snippets.

@ruprict
Created August 12, 2012 12:10
Show Gist options
  • Select an option

  • Save ruprict/3331622 to your computer and use it in GitHub Desktop.

Select an option

Save ruprict/3331622 to your computer and use it in GitHub Desktop.
Riddle
class Riddle
include DataMapper::Resource
property :id, Serial
property :title, String
property :html, Text
property :css, Text
property :js, Text
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