newbie: append serialized integers into database column and retrieve them back
问题 How Could I store integers (user id's ranging from 1 to 9999) serialized in a database column and retrieve them back? In my User model I have invites column, User model serialize: invites invites = text field Now I'm trying to do 2 things: Append the user_id integer (from 1 to 9999) serialized in a column "invites" Retrieve all the user id's back from the User.invited column ( deserialize it ? ) 回答1: From the fine manual: serialize(attr_name, class_name = Object) If you have an attribute that