Skip to content
Browse files

fixed array() bullshit again

  • Loading branch information...
1 parent 5e56cc2 commit 095e9c1c8898cf51192ef128639795bc19c75a9a Devin Austin committed Apr 27, 2010
View
BIN Survey-Perl/db/answers.db 100644 → 100755
Binary file not shown.
View
11 Survey-Perl/lib/Survey/Perl/Answers/Schema.pm
@@ -1,15 +1,20 @@
package Survey::Perl::Answers::Schema;
+# Created by DBIx::Class::Schema::Loader
+# DO NOT MODIFY THE FIRST PART OF THIS FILE
+
use strict;
use warnings;
use base 'DBIx::Class::Schema';
-__PACKAGE__->load_namespaces;
+__PACKAGE__->load_namespaces(
+ result_namespace => 'Result',
+);
-# Created by DBIx::Class::Schema::Loader v0.04006 @ 2009-09-11 17:06:47
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:nbZ7hOUzma87ik9kPCetYw
+# Created by DBIx::Class::Schema::Loader v0.04006 @ 2010-04-27 18:46:38
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:t6Wdvwi0JqgnF0U3q2XPTQ
# You can replace this text with custom content, and it will be preserved on regeneration
View
35 Survey-Perl/lib/Survey/Perl/Controller/Survey.pm
@@ -30,29 +30,36 @@ sub get_root : Chained("survey_base") : PathPart("") : Args(0) {
sub finish_survey : Chained("survey_base") PathPart("finish") Args(0) {
my ( $self, $c ) = @_;
my $answers = $c->req->params;
- $c->log->debug( "Params: " . Dumper $answers);
+
delete $answers->{'submit'};
my @multis;
- $c->log->debug( "Industries: " . Dumper $answers->{'industries'} );
- push @multis, { industries => $_ } for [ $answers->{'industries'} ];
-
- push @multis, { perl_versions => $_ } for [ $answers->{'perl_versions'} ];
- push @multis, { os_dev => $_ } for [ $answers->{'os_dev'} ];
- push @multis, { os_deployment => $_ } for [ $answers->{'os_deployment'} ];
- push @multis, { perl_editors => $_ } for [ $answers->{'perl_editors'} ];
- push @multis, { perl_editors_secondary => $_ } for [ $answers->{'perl_editors_secondary'} ];
+ my $industries = $answers->{'industries'};
+ my $perls = $answers->{'perl_versions'};
+ my $os = $answers->{'os_dev'};
+ my $os_deploy = $answers->{'os_deployment'};
+ my $editors = $answers->{'perl_editors'};
+ my $secondary_editors = $answers->{'perl_editors_secondary'};
+
+ push @multis, map +{ perl_versions => $_ }, @$perls;
+ push @multis, map +{ os_dev => $_ }, @$os;
+
+ push @multis, map +{ os_deployment => $_ }, @$os_deploy;
+ push @multis, map +{ perl_editors => $_ }, @$editors;
+ push @multis, map +{ perl_editors_secondary => $_ }, @$secondary_editors;
delete $answers->{$_}
for qw/ industries perl_versions os_dev field os_deployment perl_editors perl_editors_secondary/;
- $c->log->debug( "multis: " . Dumper @multis );
+ push @multis, $answers;
+ $c->log->debug( "multis: " . Dumper \@multis );
my $rs = $c->model('Answers')->txn_do(
sub {
- $c->model('Answers::Survey')->populate( \@multis )
- or die "Could not submit survey answers: $!";
+ $c->log->debug('creating answers');
+ $c->model('Answers::Survey')->populate(
+ \@multis
- $c->model('Answers::Survey')->create($answers)
- or die "Could not submit survey answers: $!";
+ ) or die "Could not submit survey answers: $!";
}
);
+ $c->log->debug("Rs: $rs");
}
View
6 Survey-Perl/script/make_schema.pl
@@ -9,18 +9,20 @@
if (@ARGV) {
my $table = shift @ARGV;
%options = ( constraint => $table,
+
components => [@ARGV]);
}
-make_schema_at("PerlSurvey::Schema",
+make_schema_at("Survey::Perl::Answers::Schema",
{
%options,
debug => 1,
relationships => 1,
use_namespaces => 1,
dump_directory => "$Bin/../lib" ,
+ overwrite_modifications=> 1,
},
- ["dbi:SQLite:dbname=$Bin/../db/survey.db",
+ ["dbi:SQLite:$Bin/../db/survey.db",
"",""]);
View
25 Survey-Perl/t/survey_UI.t
@@ -466,31 +466,6 @@
<td>submit</td>
<td></td>
</tr>
-<tr>
- <td>selectFrame</td>
- <td>cvgtbpjcujyse</td>
- <td></td>
-</tr>
-<tr>
- <td>click</td>
- <td>link=Inbox (1)</td>
- <td></td>
-</tr>
-<tr>
- <td>selectFrame</td>
- <td>relative=up</td>
- <td></td>
-</tr>
-<tr>
- <td>clickAndWait</td>
- <td>link=A. Pimp-Named Slickback</td>
- <td></td>
-</tr>
-<tr>
- <td>click</td>
- <td>link=Like</td>
- <td></td>
-</tr>
</tbody></table>
</body>

0 comments on commit 095e9c1

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