some changes for rails 3 and changed the tables to not use table_name