Associating API data with my Rails model

I have an app that pulls in venue info from Foursquare. I want to be able to add a Comment model that is associated with the Foursquare venue info (i.e a venue has_many comments). However, I do not have a venue model as this . I am wondering how do I associate my Comment model with the Foursquare venue info? SInce I don’t have a Venue model, how can my Comment “belongs_to” a venue?

Any advice on how to approach this would be appreciated.

What do you mean that you do not have a venue model?

Because I’m pulling data from Foursquare and displaying it, I didn’t create a venue model. Should I?

Yes. If you are sure that you need a Venue model always.

What if don’t create a venue model? Just for my information, how would I associate my Comment model with info from Foursquare? For example, what replaces “belongs_to” in this instance?

No on else has any thoughts?

If you don’t need to know the venue details, only Foursquare’s internal venue ID for the particular comment, then could you just use a single field in the comment - i.e. no association needed.

Of course, if you ever want to return the venue name or other details to your users alongside the comments, then it’s probably useful to pull this data in from Foursquare and store locally in a model, if only to stop having to do API calls to Foursquare over and over to get this info.

Okay, that helps. I’m thinking I should create a venue model :slight_smile: Thanks.