I'm thinking along the lines of:

libs/
.. calculations.rb

= which would run calculations for standard deviation and variation on 
data provided to it...

libs/tasks/
.. calculations.rake

desc "Calculate Ratings"
task :calculate_all_ratings => :environment do

  calculate_rushing = RushingOffense.find(:all)
  calculate_rushing.ratings
  # need to store the results somewhere...

end

= which would access each model and use a calculation method

RushingOffense model is part of inheritance_template.rb so the method 
would be located in there...

class InheritanceTemplate < ActiveRecord::Base
  self.abstract_class = true

  def self.ratings
    calculation_object = Calculations.new(statistic1, statistic2, etc.)
    etc..
  end

end

= which would access the calculations.rb file which contains the method 
for Calculations.new

Now I just need to figure out if this is a good approach, whether or not 
I need to tie it into another controller as far as tasking goes, and how 
to make it more automated...


-- 
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 rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to