Skip to content

Instantly share code, notes, and snippets.

@jamespenguin
Created July 16, 2014 12:51
Show Gist options
  • Save jamespenguin/93860f6520cc46f5e5ca to your computer and use it in GitHub Desktop.
Save jamespenguin/93860f6520cc46f5e5ca to your computer and use it in GitHub Desktop.
class Series < Sequel::Model(:series)
one_to_many :chapters
def validate
validates_unique :title
validates_format /([0-9]{4})?/, :year
# validates_type TrueClass, :available
# validates_type TrueClass, :completed
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment