Module: PgAggregates

Defined in:
lib/pg_aggregates.rb,
lib/pg_aggregates/railtie.rb,
lib/pg_aggregates/version.rb,
lib/pg_aggregates/file_version.rb,
lib/pg_aggregates/schema_dumper.rb,
lib/pg_aggregates/command_recorder.rb,
lib/pg_aggregates/schema_statements.rb,
lib/pg_aggregates/aggregate_definition.rb

Defined Under Namespace

Modules: CommandRecorder, SchemaDumper, SchemaStatements Classes: AggregateDefinition, Error, FileVersion, Railtie

Constant Summary collapse

VERSION =
"0.2.3"

Class Method Summary collapse

Class Method Details

.databaseObject



33
34
35
# File 'lib/pg_aggregates.rb', line 33

def database
  ActiveRecord::Base.connection
end

.loadObject



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/pg_aggregates.rb', line 17

def load
  # This is crucial - we must ensure proper load order:
  # 1. extensions
  # 2. types
  # 3. functions
  # 4. aggregates
  # 5. tables

  # Add schema statements and command recorder
  ActiveRecord::ConnectionAdapters::AbstractAdapter.include PgAggregates::SchemaStatements
  ActiveRecord::Migration::CommandRecorder.include PgAggregates::CommandRecorder

  # Hook into the schema dumper, with dependency awareness
  ActiveRecord::SchemaDumper.prepend PgAggregates::SchemaDumper
end