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? -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
> 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"... -phiilp -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.