On Tuesday, January 14, 2014 8:52:20 AM UTC, Thompson Edolo wrote:
>
> Thanks for replying. I'm not really sure I know what a "Test
> fixture" is though. This is what I'm trying to do. The soccer league in my
> country doesn't have any true sites like ESPN Soccernet.com. I am trying to
> replicate that.
>
Some terminology mixup here - Tamouse is referring to a facility rails
provides for setting up data for your automated tests ("text fixtures")
whereas I believe you are using fixture in the sense of the set of games
that are to be played over a season.
>
> I have a fixture model, it has a home_team column and an away_team column.
> These columns are supposed to be foreign keys to a Team model, I don't know
> how to set that up.
>
> If you do
belongs_to :home_team, :class_name => 'Team'
belongs_to :away_team, :class_name => 'Team'
Then rails will assume the presence of home_team_id and away_team_id
columns and will assume that they are pointing at the id column from the
Team model.
It sounds like your post model would also need an (optional) fixture_id
column that would record that is discussing that particular fixture
Fred
Then I have a scheduled_at column and a played column that is a Boolean.
> I'd like a scenario where the fixtures/index shows all the matches for the
> present week with a calendar to browse future and past fixtures.
>
> Hopefully this would make my previous post a bit clearer.
>
> Thanks
>
> On Tuesday, January 14, 2014 8:16:12 AM UTC+1, tamouse wrote:
>>
>>
>>
>>
>> On Mon, Jan 13, 2014 at 6:44 PM, Thompson Edolo <[email protected]>wrote:
>>
>>> Hello everyone. I'm currently building a blog in Rails 4 to serve news
>>> from the local soccer league in my country. The news part has been a breeze
>>> but I have not been able to code the fixtures and result portion.
>>>
>>> I have been totally stumped as i don't even have an idea on how best to
>>> go about this. To make matters worse, I have to associate these
>>> fixtures/results to their respective pre-match previews and post-match
>>> reviews(I intend to make these normal post entries with a category).
>>>
>>> Please, I might not necessarily need actual codes. Pseudo codes would
>>> suffice.
>>>
>>> Thanks.
>>>
>>> PS: If you need more info about how i have the app setup, just ask.
>>> Thanks in advance.
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Ruby on Rails: Talk" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to [email protected].
>>> To post to this group, send email to [email protected].
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/rubyonrails-talk/f4e9cea4-a870-47b7-901e-9a416db04234%40googlegroups.com
>>> .
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>
>>
>> Are you talking about test fixtures here? Or something else? Test
>> fixtures are YAML files that load data into your database for testing.
>>
>> I'm also lso quite unclear what you mean to produce for results. It's too
>> generic a term. Do you mean match results? Displaying those seems like it
>> would be rather straight forward; the difficult thing would be obtaining
>> the data, unless you plan to enter it by hand from some other place.
>>
>
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/rubyonrails-talk/e679e0b2-b34d-4f67-8fa6-98261e4fd088%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.