From 864e500817e7bcda4753f001ba862f7adbdb1c15 Mon Sep 17 00:00:00 2001 From: David Stosik Date: Tue, 20 Mar 2018 18:08:11 +0000 Subject: Document config.active_record.fk_ignore_pattern --- guides/source/configuring.md | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'guides/source') diff --git a/guides/source/configuring.md b/guides/source/configuring.md index 368b74f708..8c328f46c7 100644 --- a/guides/source/configuring.md +++ b/guides/source/configuring.md @@ -374,6 +374,12 @@ All these configuration options are delegated to the `I18n` library. having to send a query to the database to get this information. Defaults to `true`. +* `config.active_record.fk_ignore_pattern` allows setting a different regular + expression that will be used to decide whether a foreign key's name should be + dumped to db/schema.rb or not. By default, foreign key names starting with + `fk_rails_` are not exported to the database schema dump. + Defaults to `/^fk_rails_[0-9a-f]{10}$/`. + The MySQL adapter adds one additional configuration option: * `ActiveRecord::ConnectionAdapters::Mysql2Adapter.emulate_booleans` controls whether Active Record will consider all `tinyint(1)` columns as booleans. Defaults to `true`. -- cgit v1.2.3 From f6e612b2723ca7ae730ba3e98267c19356b386b3 Mon Sep 17 00:00:00 2001 From: David Stosik Date: Thu, 22 Mar 2018 10:12:58 +0000 Subject: Move fk_ignore_pattern from config.active_record to SchemaDumper This makes more sense, as the foreign key ignore pattern is only used by the schema dumper. --- guides/source/configuring.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'guides/source') diff --git a/guides/source/configuring.md b/guides/source/configuring.md index 8c328f46c7..8bdba4b3de 100644 --- a/guides/source/configuring.md +++ b/guides/source/configuring.md @@ -374,12 +374,6 @@ All these configuration options are delegated to the `I18n` library. having to send a query to the database to get this information. Defaults to `true`. -* `config.active_record.fk_ignore_pattern` allows setting a different regular - expression that will be used to decide whether a foreign key's name should be - dumped to db/schema.rb or not. By default, foreign key names starting with - `fk_rails_` are not exported to the database schema dump. - Defaults to `/^fk_rails_[0-9a-f]{10}$/`. - The MySQL adapter adds one additional configuration option: * `ActiveRecord::ConnectionAdapters::Mysql2Adapter.emulate_booleans` controls whether Active Record will consider all `tinyint(1)` columns as booleans. Defaults to `true`. @@ -406,10 +400,16 @@ by adding the following to your `application.rb` file: Rails.application.config.active_record.sqlite3.represent_boolean_as_integer = true ``` -The schema dumper adds one additional configuration option: +The schema dumper adds two additional configuration options: * `ActiveRecord::SchemaDumper.ignore_tables` accepts an array of tables that should _not_ be included in any generated schema file. +* `ActiveRecord::SchemaDumper.fk_ignore_pattern` allows setting a different regular + expression that will be used to decide whether a foreign key's name should be + dumped to db/schema.rb or not. By default, foreign key names starting with + `fk_rails_` are not exported to the database schema dump. + Defaults to `/^fk_rails_[0-9a-f]{10}$/`. + ### Configuring Action Controller `config.action_controller` includes a number of configuration settings: -- cgit v1.2.3