class Participation < ActiveRecord::Base
attr_accessible :meeting_id, :player_id
You need belongs_to metting and player here.
Sure thing, sorry cleaned it up by mistake.
how to select all meetings in the specified city together with their
addresses and players?
By a city do you mean a Place or a string in player.city?
Colin
I mean a Place, as a Meeting occurs in some Place, so it will be all
Meetings in all Places filtered out by the city.
Also I discover that it is possible to use counter_cache to have a
number of Players, who joined the Meeting in the player_cache column, is
that right?
class Participation < ActiveRecord::Base
attr_accessible :meeting_id, :player_id
You need belongs_to metting and player here.
Sure thing, sorry cleaned it up by mistake.
how to select all meetings in the specified city together with their
addresses and players?
By a city do you mean a Place or a string in player.city?
Colin
I mean a Place, as a Meeting occurs in some Place, so it will be all
Meetings in all Places filtered out by the city.
You are using the word city again, so once again it is not clear what you mean.
Back to the original question, if you have a place, @place for
example, then its meetings are @place.meetings and for each meeting
the players are meeting.players. You have also asked for the address
of the meeting, but you know that already as it is in @place.
Also I discover that it is possible to use counter_cache to have a
number of Players, who joined the Meeting in the player_cache column, is
that right?
I have not used counter_cache but i believe it can be used for such things.