my ($self) = @_;
foreach my $attr ($self->parameter_attributes) {
my $predicate = $attr->predicate;
- if ($attr->is_required) {
+ if ($self->attribute_is_required($attr)) {
return 0 unless $self->$predicate;
}
if ($attr->has_valid_values) {
implements error_for_attribute => as {
my ($self, $attr) = @_;
- if ($attr->is_required) {
+ if ($self->attribute_is_required($attr)) {
my $predicate = $attr->predicate;
unless ($self->$predicate) {
return $attr->name." is required";
return; # ok
};
+ implements attribute_is_required => as {
+ my ($self, $attr) = @_;
+ return $attr->is_required;
+ };
+
sub sync_all { }
};
};
implements fragment field_is_required {
- if ( $_{viewport}->attribute->is_required ) {
+ my $model = $_{viewport}->model;
+ my $attr = $_{viewport}->attribute;
+ if ( $model->attribute_is_required($attr) ) {
render 'field_is_required_yes';
} else {
render 'field_is_required_no';