aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/model_schema.rb
diff options
context:
space:
mode:
authorSean Griffin <sean@seantheprogrammer.com>2016-03-31 13:15:17 -0600
committerSean Griffin <sean@seantheprogrammer.com>2016-03-31 13:15:17 -0600
commit7b82e1c77b48cb351da4e0ed6ea0bac806d4925c (patch)
tree26af2c11dd647041d05cecac03f1a7eba71baf21 /activerecord/lib/active_record/model_schema.rb
parent04ac5655be91f49cd4dfe2838df96213502fb274 (diff)
downloadrails-7b82e1c77b48cb351da4e0ed6ea0bac806d4925c.tar.gz
rails-7b82e1c77b48cb351da4e0ed6ea0bac806d4925c.tar.bz2
rails-7b82e1c77b48cb351da4e0ed6ea0bac806d4925c.zip
Deprecate table names containing dots
Dots have special meaning in most backends (e.g. everything except SQLite3), as well as most methods that work with table or column names. This isn't something that we ever explicitly supported, but there's at least one case of somebody using this (see #24367), so we'll go through a deprecation cycle as normal.
Diffstat (limited to 'activerecord/lib/active_record/model_schema.rb')
-rw-r--r--activerecord/lib/active_record/model_schema.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/model_schema.rb b/activerecord/lib/active_record/model_schema.rb
index 52eab952e1..4c836378e0 100644
--- a/activerecord/lib/active_record/model_schema.rb
+++ b/activerecord/lib/active_record/model_schema.rb
@@ -144,6 +144,13 @@ module ActiveRecord
def table_name=(value)
value = value && value.to_s
+ if value && value.include?(".")
+ # When this deprecation warning is removed, revert commit 04ac5655be91f49cd4dfe2838df96213502fb274
+ ActiveSupport::Deprecation.warn(
+ 'Support for table names containing "." is deprecated and will be removed in Rails 5.1.'
+ )
+ end
+
if defined?(@table_name)
return if value == @table_name
reset_column_information if connected?