Prev | Current Page 514 | Next

Kevin Marshall, Chad Pytel, and Jon Yurek

"Pro Active Record: Databases with Ruby and Rails"


new(name, default, sql_type = nil, null = true)
Create a new column in the database table with this method: name is the name of the new column;
default is the typecasted default value for the new column; sql_type specifies the type,
including the length of the new column; and null specifies whether this column allows NULL as
a value.
string_to_binary(value)
Convert Strings to BLOBs with this method.
string_to_date(value)
This method converts the given value, which is a String, to a Date.
string_to_dummy_time(value)
string_to_dummy_time converts the given value, which is a String containing only time information,
with dump information.
APPENDIX ?–  ACTIVE RECORD METHODS IN DETAIL 236
string_to_time(value)
This one converts the given value, which is a String containing date and time information, to
a Time value.
value_to_boolean(value)
Convert the given value to a boolean with this method. It returns true for true, "true", "t",
and "1" and returns false for all other values.
value_to_decimal(value)
With this method, you can convert the given value to a BigDecimal.


Pages:
502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526