The "integer", "string" and "float" methods are just shorthands for
the column call using that type.
It's also the "new way" (new since Rails 2, not that new now) of
writing migrations. And the "timestamps" will create both a created_at
and also an updated_at column.
The "integer", "string" and "float" methods are just shorthands for
the column call using that type.
It's also the "new way" (new since Rails 2, not that new now) of
writing migrations. And the "timestamps" will create both a created_at
and also an updated_at column.
If crawling through the NCAA website is something that you want to
automate, as "crawl daily at 12 pm" you can create a rake task in your
Rails application that calls this code and then put the rake task to
be run as a cron job:
#ncaa_crawler.rake at /lib/tasks
rake :ncaa_crawler => :environment do
#here goes the code that gets the NCAA data
#and saves it into the database
end
The :environment thing tells Rake that it should load the rails
application before executing the task, so all objects defined in your
Rails application will be available, like your ActiveRecord models.
This code you have shown should be placed into a class in your
application and be called on this rake task.
Thanks again Mauricio, I will look into trying this out. Is the rake
task able to be defined periodically by a weekday? For instance, if I
want the job to only pull data on a Monday (is that feasible)?