I have a problem with a legacy database that has a sequence of daily
tables (generated elsewhere) of the form
In addition, I’m using ar-extensions and composite primary keys, with a
slight monkeypatch to get them working together for bulk inserts.
My definition is currently like:
class Header < ActiveRecord::Base
All this is working fine, right up until midnight, when the tables
should change, but of course my definition is only dynamic if it is run
again. Since I have long running jobs that need to run across the time
boundaries, I thought that the best thing to do would be to call
from the initialization of the interface that first attaches to the
database. This isn’t strictly speaking Rails code, but relies heavily on
ActiveRecord, ActiveSupport etc. Is there a more conventional way to
handle this sort of thing?