hi
i know data type changes to the corresponding ruby one when reading
data from database,but wonder how it changes when writing data to
database.
for example,if there is a new answer (
answer=Answer.new(params[:answer]) ),it will be validated,and saved to
database,but how does the attribute value's datatype change during this
process?it is always string type until be saved to database?
i use rails3 active_model's new feature,really want to know the above?
can you help me?
i know data type changes to the corresponding ruby one when reading
data from database,but wonder how it changes when writing data to
database.
for example,if there is a new answer (
answer=Answer.new(params[:answer]) ),it will be validated,and saved to
database,but how does the attribute value's datatype change during this
process?it is always string type until be saved to database?
i use rails3 active_model's new feature,really want to know the above?
can you help me?
Dig through the source... I would imagine it would be in active record (or whatever ORM you use) not in active model... look for "type cast"...