L
Leslie Viljoen
Hello
I am processing database rows and I see that there are "bit" columns
that come out of ActiveRecord as true or false. I wanted binary digits
so I did this:
class FalseClass
def to_i
0
end
end
class TrueClass
def to_i
1
end
end
..which may or may not be really dumb. So is it really dumb?
--
Man's unfailing capacity to believe what he prefers to be true rather
than what the evidence shows to be likely and possible has always
astounded me. We long for a caring Universe which will save us from
our childish mistakes, and in the face of mountains of evidence to the
contrary we will pin all our hopes on the slimmest of doubts. God has
not been proven not to exist, therefore he must exist.
- Prokhor Zakharov
I am processing database rows and I see that there are "bit" columns
that come out of ActiveRecord as true or false. I wanted binary digits
so I did this:
class FalseClass
def to_i
0
end
end
class TrueClass
def to_i
1
end
end
..which may or may not be really dumb. So is it really dumb?
--
Man's unfailing capacity to believe what he prefers to be true rather
than what the evidence shows to be likely and possible has always
astounded me. We long for a caring Universe which will save us from
our childish mistakes, and in the face of mountains of evidence to the
contrary we will pin all our hopes on the slimmest of doubts. God has
not been proven not to exist, therefore he must exist.
- Prokhor Zakharov