You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Shouldn't the behavior be to default to interpret 0 and "0" as false and 1 and "1" as true? Or is the belief that this pattern is "not common or reliable enough to encode in a library"?
The text was updated successfully, but these errors were encountered:
require 'gorillib/model'
class Foo
include Gorillib::Model
field :boolsy, :boolean
end
[true, false, 'true', 'false', '0', '1', 0, 1,].each do |thing|
puts [thing.inspect, Foo.receive(boolsy: thing).boolsy.to_s].join("\t")
end
Using latest Gorillib (0.5.0) I see
$ ruby bool_test.rb
true true
false false
"true" true
"false" false
"0" true
"1" true
0 true
1 true
Shouldn't the behavior be to default to interpret 0 and "0" as false and 1 and "1" as true? Or is the belief that this pattern is "not common or reliable enough to encode in a library"?
—
Reply to this email directly or view it on GitHub.
Run the following script
Using latest Gorillib (0.5.0) I see
Shouldn't the behavior be to default to interpret
0
and"0"
asfalse
and1
and"1"
astrue
? Or is the belief that this pattern is "not common or reliable enough to encode in a library"?The text was updated successfully, but these errors were encountered: