Skip to content
Browse files

FormValidator::Liteの最新版で十分になった

  • Loading branch information...
1 parent 1c755e1 commit a558512a98f1816e840ff194418760c7e7d9ee35 @nekokak committed Feb 16, 2010
Showing with 2 additions and 23 deletions.
  1. +2 −23 lib/Kamui/Plugin/FormValidatorLite.pm
View
25 lib/Kamui/Plugin/FormValidatorLite.pm
@@ -14,6 +14,7 @@ sub register_method {
package Kamui::Plugin::FormValidatorLite::Backend;
use Kamui;
use String::CamelCase qw/camelize/;
+use FormValidator::Lite;
sub new {
my ($class, $c) = @_;
@@ -35,7 +36,7 @@ sub valid {
};
my $validator = $valid_class->new(
- engine => Kamui::Plugin::FormValidatorLite::Backend::Base->new($self->c->req),
+ engine => FormValidator::Lite->new($self->c->req),
context => $self->c,
);
@@ -44,27 +45,5 @@ sub valid {
return $validator;
}
-package Kamui::Plugin::FormValidatorLite::Backend::Base;
-use Kamui;
-use base 'FormValidator::Lite';
-
-sub get_error_message_from_param {
- my ($self, $target_param) = @_;
-
- my %dup_check;
- my @messages;
- for my $err (@{$self->{_error_ary}}) {
- my $param = $err->[0];
- my $func = $err->[1];
-
- next if $target_param ne $param;
- next if exists $dup_check{"$param.$func"};
- push @messages, $self->get_error_message( $param, $func );
- $dup_check{"$param.$func"}++;
- }
-
- return @messages;
-}
-
1;

0 comments on commit a558512

Please sign in to comment.
Something went wrong with that request. Please try again.