search for: ydspgm

Displaying 3 results from an estimated 3 matches for "ydspgm".

2009 Jul 16
9
Please help me understand how arrays are translated in rails
...var = model.compiled_this_week.find(:all) var.each_with_index do |rows, i| puts "#{model} [ Row #{i} | Team ID = #{rows.team_id} | Team = #{rows.team.name} | #{datavar} = #{rows.__send__(datavar)}" end end This will give me: TotalOffense [ Row 0 | Team ID = 5 | Team = Tulsa | ydspgm = 569.86 TotalOffense [ Row 1 | Team ID = 47 | Team = Houston | ydspgm = 562.77 TotalOffense [ Row 2 | Team ID = 20 | Team = Oklahoma | ydspgm = 547.86 etc. etc. So far, so good. I can at least see the data that I want. Now, I want to assign the Team ID and the ydspgm to variables that I can man...
2009 Jun 25
7
Join Tables
I just have a few questions about join tables. From my understanding the following applies (correct me if I''m wrong): 1.Join tables are always named with the names of the two associated tables, in alphabetical order, separated by an underscore. 2.The foreign key fields are named with the name of the table they are referencing, with _id appended. 3.The foreign key is referencing a
2009 Jul 17
19
I need help saving table data from a rake task
...n create and save a large dataset to a table based on multiple returned arrays from a Rake task. Here is my example using just two arrays (there are 14 in this particular rake task): update_tsos_offense = TsosOffense.new to_team_id, to_ppcs = update_tsos_offense.calculate_tsos(TotalOffense, "ydspgm", "desc") ro_team_id, ro_ppcs = update_tsos_offense.calculate_tsos(RushingOffense, "ydspg", "desc") This task starts with creating a new object (TsosOffense) which is the model that houses the table I will eventually write/save data to. It then calls a method fr...