Page.find_by_disabled(false)
produces
##### Aws::SdbInterface request:
sdb.amazonaws.com:443/?
AWSAccessKeyId=SOMEKEYID&Action=Select&SelectExpression=SELECT%20%2A
%20FROM%20%60pages%60%20WHERE%20disabled%3D%20LIMIT
%201&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2010-10-01T20%3A00%3A56.000Z&Version=2009-04-15&Signature=SOMESIGNATURE
####
From the looks of it, the query is not converting the boolean false to
a string "false". Boolean true does not produce the query error but
only find attributes with the string "true", attributes with "1" are
ignored.
I begun homogenizing my booleans with a before save that converts all
boolean values with the literal string representation ie true =>
"true", false => "false", which solves the "1", "0" problem for me but
some folks may prefer "0", "1"
Not sure its possible but it would be nice if the finds would identify
attributes as boolean and expand the query string to include all
"reasonable" string boolean representations, but this too seems like
I'm asking a lot of simple_record
Just an idea.
On Oct 1, 2:46 pm, Travis Reeder <
tree...@gmail.com> wrote:
> Hmmm, it should work I would think. Can you send in the select expression
> it's sending in, should show up with that AwsError.
>
> On Thu, Sep 30, 2010 at 4:05 PM, joshmckin <
joshmc...@gmail.com> wrote:
> > I would like to use find_by to query a model with a boolean value, but
> > get Aws::AwsError: InvalidQueryExpression: The specified query
> > expression syntax is not valid.
>
> > For example:
>
> > class Pages < SimpleRecord::Base
> > has_booleans :disabled
> > end
>
> > Pages.find_all_by_disabled(false)
>
> > I guessing this is probably not going to possible since the boolean is
> > saved a string in simpledb and the find_by methods would not be smart
> > enough to look for all the string forms of boolean values in the
> > simpledb that simple record would use (like "true", "1", "0", "false",
> > nil/null...).
>
> > Am I correct?
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "SimpleRecord" group.
> > To post to this group, send email to
simple...@googlegroups.com.
> > To unsubscribe from this group, send email to
> >
simple-recor...@googlegroups.com<
simple-record%2Bunsu...@googlegroups.com>
> > .