I have the following relationship
Foo has_many Bar
Then i have the Foo model however the Bar is just a String which is an id.
I could create a Bar model consisting only the String id, but i want to know if is possible and how to make Foo query all Bars and store it inside as a list in the Foo model.
If i have to use SQL it is fine.
Another alternative is to remove the Bar table and then put it as a field in the Foo table however this would require to serialize and would difficult and make SQL search inefficient guess.
The schema is the follwing
Foo has_many Foo_Bars and
Bar has_many Bar_Foos
The reason for not been Foo has_and_belongs_to_many Bar is because the add information of a single Foo or a single Bar would be a never ending chain, think this as a bipartite graph such as Foo and Bar are a disjoint set.
The database is shared with another application i am using rails as a visual interface to manage the data.
My question is do i really need a Foo_Bars model ?