[Jifty-commit] jifty branch, jifty_client, updated. a87874a5176ad37b5f91429c9aae98f6365f5f93
Jifty commits
jifty-commit at lists.jifty.org
Mon May 3 06:08:54 EDT 2010
The branch, jifty_client has been updated
via a87874a5176ad37b5f91429c9aae98f6365f5f93 (commit)
from 116dd63f84f2b2d8c664d234cd3b26e994eb45f1 (commit)
Summary of changes:
lib/Jifty/Plugin/REST/Dispatcher.pm | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
- Log -----------------------------------------------------------------
commit a87874a5176ad37b5f91429c9aae98f6365f5f93
Author: Shawn M Moore <sartak at bestpractical.com>
Date: Mon May 3 18:08:33 2010 +0800
Boolean type constraint
diff --git a/lib/Jifty/Plugin/REST/Dispatcher.pm b/lib/Jifty/Plugin/REST/Dispatcher.pm
index 5c78fef..8b42ea5 100644
--- a/lib/Jifty/Plugin/REST/Dispatcher.pm
+++ b/lib/Jifty/Plugin/REST/Dispatcher.pm
@@ -977,17 +977,21 @@ sub show_joose_class {
}
if ($col->name eq 'id') {
- $props->{coerce} = 1;
$props->{isa} = 'Joose.Type.Int';
}
elsif ($col->is_string) {
- $props->{coerce} = 1;
$props->{isa} = 'Joose.Type.Str';
}
elsif ($col->is_numeric) {
- $props->{coerce} = 1;
$props->{isa} = 'Joose.Type.Num';
}
+ elsif ($col->is_boolean) {
+ $props->{isa} = 'Joose.Type.Bool';
+ }
+
+ # always coerce because our REST API output is always strings even
+ # for int and bool columns
+ $props->{coerce} = 1 if $props->{isa};
$cols->{$col->name} = $props;
}
-----------------------------------------------------------------------
More information about the Jifty-commit
mailing list