Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Subtask
- include DataMapper::Resource
- property :id, Serial, :nullable => false
- property :description, String, :nullable => false
- property :type, Discriminator, :nullable => false
- # Abstract
- def initialize (*params)
- raise NotImplementedError, "Subtask is abstract!" if self.class == Subtask
- super
- end
- end
- class TextTask < Subtask
- end
- class ImageTask < Subtask
- property :submissions, Integer, :nullable => false
- property :someunique_id, Integer, :unique_index => true
- end
Add Comment
Please, Sign In to add comment