Well large queries are one thing but this is probably too large:
def self.start(teamone, teamtwo)
Team.find(teamone,teamtwo, :joins => [ :tsrs_ratings,
:rushing_offenses, :passing_offenses, :scoring_offenses,
:total_offenses, :red_zone_offenses, :fumbles_losts,
:passes_had_intercepteds, :turnovers_losts, :sacks_alloweds,
:tackles_for_loss_alloweds, :passing_efficiencies,
:first_downs_offenses, :third_down_conversion_percentages,
:fourth_down_conversion_percentages, :total_defenses,
:rushing_defenses, :pass_defenses, :scoring_defenses,
:red_zone_defenses, :fumbles_recovereds,
:passes_intercepteds, :turnovers_gaineds, :sacks,
:tackles_for_losses, :pass_efficiency_defenses, :first_downs_defenses,
:third_down_percentage_defenses,
:fourth_down_percentage_defenses, :kickoff_returns,
:punt_returns, :net_puntings, :kickoff_return_yardage_defenses,
:punt_return_yardage_defenses, :turnover_margins ])
end
I only need to select specific fields in each of those tables but how
would I go about using :select => with this? In order of which tables
are grabbed/referenced?
:joins => 1,2,3,4,5 etc..
:select => "1", "2", "3", "4", "5" etc.
?
And, my data has weekly compiled but my teams table does not. My Teams
table is static and untouched and contains exactly 120 teams. My other
data tables could contain up to 16 weeks worth of data.
I usually use a scope or condition to pull the data based on:
named_scope :compiled_this_week, lambda { { :conditions =>
['created_at > ? and created_at < ?', Time.now.beginning_of_week,
Time.now.end_of_week] } }
But, it's either going to be ambiguous in this case or it won't work
because the created_at won't apply to teams. Any tips/pointers for how
to get past this particular piece?
I'm only posting rebuttals to mark my progress but I see no one
answering or commenting on my threads so either I'm asking too much, or
giving too much information, the latter which I always thought was
better when asking questions.
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---