Displaying 2 results from an estimated 2 matches for "binary_to_str".
2006 Mar 03
0
binary_to_string/string_to_binary confusion
...;'
When it gets written to the database, it should be hex-encoded similar
to the following:
INSERT INTO binaries ("id", "data") VALUES(1, X''D20A0E21390A684AC0A80116'')
only with the hex portion being much larger.
I''m having trouble implementing binary_to_string and string_to_binary.
If I implement both of them to simply return value, then the first two
asserts pass:
assert @data == bin.data, ''Newly assigned data differs from original''
assert @data == bin.data, ''Data differs from original after save''
but the genera...
2006 Feb 05
0
Enum patch for Rails
...:string then String
when :binary then String
when :boolean then Object
+ when :enum then Symbol
end
end
@@ -61,6 +62,7 @@
when :date then self.class.string_to_date(value)
when :binary then self.class.binary_to_string(value)
when :boolean then self.class.value_to_boolean(value)
+ when :enum then value.intern
else value
end
end
@@ -77,6 +79,7 @@
when :date then
"#{self.class.name}.string_to_date(#{var_name})"
when :bina...