diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2019-06-11 04:27:15 +0900 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2019-06-13 13:52:07 +0900 |
commit | c5ecc338e863e771adcbcd87d5c23ae5e7ca7894 (patch) | |
tree | 1087510cc701b950f335f5e4cddd3f31381cf4af | |
parent | 75eb3d0cec389c9e288968b46f19bd17b5feec41 (diff) | |
download | rails-c5ecc338e863e771adcbcd87d5c23ae5e7ca7894.tar.gz rails-c5ecc338e863e771adcbcd87d5c23ae5e7ca7894.tar.bz2 rails-c5ecc338e863e771adcbcd87d5c23ae5e7ca7894.zip |
Remove duplicated `table_exists?`
`table_exists?` is already exist in `ModelSchema`.
https://github.com/rails/rails/blob/5cab344494c340ea82a35b46efa06b94f0b7730b/activerecord/lib/active_record/model_schema.rb#L339-L341
-rw-r--r-- | activerecord/lib/active_record/internal_metadata.rb | 4 | ||||
-rw-r--r-- | activerecord/lib/active_record/schema_migration.rb | 4 |
2 files changed, 0 insertions, 8 deletions
diff --git a/activerecord/lib/active_record/internal_metadata.rb b/activerecord/lib/active_record/internal_metadata.rb index e6166581f1..8f3c6d0ee3 100644 --- a/activerecord/lib/active_record/internal_metadata.rb +++ b/activerecord/lib/active_record/internal_metadata.rb @@ -28,10 +28,6 @@ module ActiveRecord where(key: key).pluck(:value).first end - def table_exists? - connection.table_exists?(table_name) - end - # Creates an internal metadata table with columns +key+ and +value+ def create_table unless table_exists? diff --git a/activerecord/lib/active_record/schema_migration.rb b/activerecord/lib/active_record/schema_migration.rb index 74547de862..dec7fee986 100644 --- a/activerecord/lib/active_record/schema_migration.rb +++ b/activerecord/lib/active_record/schema_migration.rb @@ -22,10 +22,6 @@ module ActiveRecord "#{table_name_prefix}#{schema_migrations_table_name}#{table_name_suffix}" end - def table_exists? - connection.table_exists?(table_name) - end - def create_table unless table_exists? version_options = connection.internal_string_options_for_primary_key |