Class: ActiveRecord::ConnectionAdapters::AbstractAdapter
- Inherits:
-
Object
- Object
- ActiveRecord::ConnectionAdapters::AbstractAdapter
- Defined in:
- lib/foreign_key_saver/foreign_key_saver_patches.rb
Instance Method Summary collapse
- #drop_table_with_foreign_keys(table_name, options = {}) ⇒ Object
- #quote_column_names(*column_names) ⇒ Object
Instance Method Details
#drop_table_with_foreign_keys(table_name, options = {}) ⇒ Object
90 91 92 93 |
# File 'lib/foreign_key_saver/foreign_key_saver_patches.rb', line 90 def drop_table_with_foreign_keys(table_name, = {}) remove_foreign_key_constraints_referencing(table_name) if tables.include?(table_name) # the if is an optimization for the sake of create_table with :force => true, which is crucial for db:test:prepare performance on mysql as mysql's INFORMATION_SCHEMA implementation is excrutiatingly slow; it's not needed for postgres, but does give a small boost to performance there too drop_table_without_foreign_keys(table_name, ) end |
#quote_column_names(*column_names) ⇒ Object
86 87 88 |
# File 'lib/foreign_key_saver/foreign_key_saver_patches.rb', line 86 def quote_column_names(*column_names) column_names.flatten.map {|column_name| quote_column_name(column_name)} * ', ' end |