Module: Postgresql::Check::SchemaDefinitions

Defined in:
lib/postgresql/check/schema_definitions.rb

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/postgresql/check/schema_definitions.rb', line 4

def self.included(base)
  if ActiveRecord::VERSION::STRING > '4.2'
    ActiveRecord::ConnectionAdapters::PostgreSQL::Table.class_eval do
      include Postgresql::Check::Table
    end

    ActiveRecord::ConnectionAdapters::PostgreSQL::TableDefinition.class_eval do
      include Postgresql::Check::TableDefinition
    end
  else
    base::Table.class_eval do
      include Postgresql::Check::Table
    end

    base::TableDefinition.class_eval do
      include Postgresql::Check::TableDefinition
    end
  end
end