Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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

  • Loading branch information...
commit a558512a98f1816e840ff194418760c7e7d9ee35 1 parent 1c755e1
Atsushi Kobayashi authored

Showing 1 changed file with 2 additions and 23 deletions. Show diff stats Hide diff stats

  1. +2 23 lib/Kamui/Plugin/FormValidatorLite.pm
25 lib/Kamui/Plugin/FormValidatorLite.pm
@@ -14,6 +14,7 @@ sub register_method {
14 14 package Kamui::Plugin::FormValidatorLite::Backend;
15 15 use Kamui;
16 16 use String::CamelCase qw/camelize/;
  17 +use FormValidator::Lite;
17 18
18 19 sub new {
19 20 my ($class, $c) = @_;
@@ -35,7 +36,7 @@ sub valid {
35 36 };
36 37
37 38 my $validator = $valid_class->new(
38   - engine => Kamui::Plugin::FormValidatorLite::Backend::Base->new($self->c->req),
  39 + engine => FormValidator::Lite->new($self->c->req),
39 40 context => $self->c,
40 41 );
41 42
@@ -44,27 +45,5 @@ sub valid {
44 45 return $validator;
45 46 }
46 47
47   -package Kamui::Plugin::FormValidatorLite::Backend::Base;
48   -use Kamui;
49   -use base 'FormValidator::Lite';
50   -
51   -sub get_error_message_from_param {
52   - my ($self, $target_param) = @_;
53   -
54   - my %dup_check;
55   - my @messages;
56   - for my $err (@{$self->{_error_ary}}) {
57   - my $param = $err->[0];
58   - my $func = $err->[1];
59   -
60   - next if $target_param ne $param;
61   - next if exists $dup_check{"$param.$func"};
62   - push @messages, $self->get_error_message( $param, $func );
63   - $dup_check{"$param.$func"}++;
64   - }
65   -
66   - return @messages;
67   -}
68   -
69 48 1;
70 49

0 comments on commit a558512

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