method
disable_referential_integrity
Ruby on Rails latest stable (v3.2.13)
-
0 notes -
Class: ActiveRecord::ConnectionAdapters::PostgreSQLAdapter
disable_referential_integrity()
public
Hide source
# File activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb, line 519 def disable_referential_integrity #:nodoc: if supports_disable_referential_integrity? then execute(tables.collect { |name| "ALTER TABLE #{quote_table_name(name)} DISABLE TRIGGER ALL" }.join(";")) end yield ensure if supports_disable_referential_integrity? then execute(tables.collect { |name| "ALTER TABLE #{quote_table_name(name)} ENABLE TRIGGER ALL" }.join(";")) end end


