Displaying 2 results from an estimated 2 matches for "compiled_this_week".
2009 Jul 16
9
Please help me understand how arrays are translated in rails
...making
headway into what is probably a very easy subject.
I understand arrays with at least 4 other languages but with Ruby I
haven''t found a mental connection with how I can assign variables to
arrays..
Take for example:
def calculate_tsos(model, datavar, teamvar, valvar)
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 [...
2009 Jul 17
19
I need help saving table data from a rake task
I need to find out how I can 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 =