split out can_sync_to_action from sync_to_action in anticipation of new password...
[catagits/Reaction.git] / lib / Reaction / UI / ViewPort / Field / Role / Choices.pm
index db1c3af..df8615d 100644 (file)
@@ -1,6 +1,6 @@
 package Reaction::UI::ViewPort::Field::Role::Choices;
 
-use Reaction::Class;
+use Reaction::Role;
 use URI;
 use Scalar::Util 'blessed';
 
@@ -16,7 +16,7 @@ role Choices, which {
     my ($self, $str) = @_;
     my $u = URI->new('','http');
     $u->query($str);
-    return { $u->query_form };
+    return ($u->query_keywords ? ($u->query_keywords)[0] : { $u->query_form });
   };
 
   implements obj_to_str => as {
@@ -39,7 +39,7 @@ role Choices, which {
 
   implements _build_valid_values => as {
     my $self = shift;
-    return [ $self->attribute->all_valid_values($self->action) ];
+    return [ $self->attribute->all_valid_values($self->model) ];
   };
 
   implements _build_value_choices => sub{