Skip to content

Instantly share code, notes, and snippets.

@dhoss
Forked from anonymous/gist:1227217
Created September 19, 2011 18:36
Show Gist options
  • Save dhoss/1227218 to your computer and use it in GitHub Desktop.
Save dhoss/1227218 to your computer and use it in GitHub Desktop.
package PerlFu::Web::Model::Validator::Post;
use Moose;
use namespace::autoclean;
extends 'PerlFu::Web::Model::Validator';
sub _build_profiles {
my $self = shift;
return {
title => {
required => 1,
type => 'Str',
max_length => 255,
min_length => 1
},
tags => {
required => 0,
type => 'Str',
max_length => 1024,
min_length => 1,
},
body => {
required => 1,
type => 'Str',
min_length => 1,
},
author => {
required => 1,
type => 'Int',
},
parent => {
required => 0,
type => 'Int',
},
path => {
required => 0,
type => 'Str',
min_length => 1,
},
};
}
__PACKAGE__->meta->make_immutable;
1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment