Sha256: 28de6e7b7ebcd9fc7ffd031dad1f69b0cf1c9ead58c4fcbf38b813cd676a2d4c

Contents?: true

Size: 573 Bytes

Versions: 11

Compression:

Stored size: 573 Bytes

Contents

if Rails::VERSION::MAJOR < 4
  #Fix fixtures with foreign keys, fixed in Rails4
  class ActiveRecord::ConnectionAdapters::PostgreSQLAdapter
    def disable_referential_integrity #:nodoc:
      if supports_disable_referential_integrity?
        execute(tables.collect { |name| "ALTER TABLE #{quote_table_name(name)} DISABLE TRIGGER USER" }.join(";"))
      end
      yield
    ensure
      if supports_disable_referential_integrity?
        execute(tables.collect { |name| "ALTER TABLE #{quote_table_name(name)} ENABLE TRIGGER USER" }.join(";"))
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
katello-2.4.5 lib/monkeys/foreign_keys_postgresql.rb
katello-2.4.4 lib/monkeys/foreign_keys_postgresql.rb
katello-2.4.3 lib/monkeys/foreign_keys_postgresql.rb
katello-2.4.2 lib/monkeys/foreign_keys_postgresql.rb
katello-2.4.1 lib/monkeys/foreign_keys_postgresql.rb
katello-2.4.0 lib/monkeys/foreign_keys_postgresql.rb
katello-2.4.0.rc3 lib/monkeys/foreign_keys_postgresql.rb
katello-2.4.0.rc2 lib/monkeys/foreign_keys_postgresql.rb
katello-2.4.0.rc1 lib/monkeys/foreign_keys_postgresql.rb
katello-2.2.2 lib/monkeys/foreign_keys_postgresql.rb
katello-1.5.0 lib/monkeys/foreign_keys_postgresql.rb