Colin Law wrote:
> 2010/1/13 Alpha Blue <[email protected]>:
>>  layouts: true
>>  swfs: true
>>
>> I'm reading all of these yml values through a file upload which stores
>> it into a hash.
>>
>> When saving the values to my database, all of the validators work
>> perfectly with the exception of the boolean reads.
>>
>> validates_inclusion_of :stylesheets, :javascripts, :layouts, :swfs, :in
>> => [true, false]
> 
> Would it work if you used :in ["true","false"]?  I have not tried it.
> 
> Colin

Yeah, I had tried that and also tried using %w with the same values, 
both of which caused all 4 validations on the boolean fields within the 
yaml file to fail.  It probably would work if I put my yaml file to use 
something similar:

stylesheets:  "true"
javascripts:  "false"
etc.

It probably requires the implicit string reasoning for those values.

I'm going to keep it the way I have it right now though.

Thanks for the follow-up Colin, it's always appreciated.

-- 
Posted via http://www.ruby-forum.com/.
-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.


Reply via email to