search for: delete_flag

Displaying 1 result from an estimated 1 matches for "delete_flag".

Did you mean: deleg_flag
2006 Dec 14
3
Problem with ActiveRecord and Associations
Hi, I''m having what I believe to be a typecast problem with ActiveRecord and Associations. In the code below, I need to flag a contact record for deletion if the contact doesn''t have any addresses or books records: sql = "select id, delete_flag from contacts where id = #{params[:id]}" contact = Contact.find_by_sql(sql) if (contact[0].addresses.count + contact[0].books) > 0 #contact = Contact.find_by_sql(sql) contact[0].update_attribute(:delete_flag,''true'') end The if statement is correctly getting the co...