Module: PgCron::SchemaDumper Private

Defined in:
lib/pg_cron/schema_dumper.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Writes scheduled jobs into db/schema.rb.

F(x)'s SchemaDumper with functions/triggers replaced by jobs. Hooking #tables rather than #extensions is F(x)'s choice and is load-bearing: #extensions is private AND redefined by the PostgreSQL-specific dumper, so a module prepended to ActiveRecord::SchemaDumper never intercepts it and the dump silently comes out with no cron section.

Emitted after super, so the cron block follows the tables and F(x)'s functions — which matters, because a create_cron_job line schedules a command that generally calls them.

Instance Method Summary collapse

Instance Method Details

#tables(stream) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



18
19
20
21
22
# File 'lib/pg_cron/schema_dumper.rb', line 18

def tables(stream)
  super

  jobs(stream)
end