added active record stuff for favorites