aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/model_schema.rb
diff options
context:
space:
mode:
authorSean Griffin <sean@seantheprogrammer.com>2016-01-08 13:42:48 -0700
committerSean Griffin <sean@seantheprogrammer.com>2016-01-08 13:42:48 -0700
commitc1a1595740b243bed02f5e59090cc58dac77bbf3 (patch)
treec22f9ed3df30b9a5aa3c2f2b9e112cecee382c75 /activerecord/lib/active_record/model_schema.rb
parentd0393fccffc118a5de37654aa222774b66123393 (diff)
parentd70c68d76abcbc24ef0e56b7a7b580d0013255dd (diff)
downloadrails-c1a1595740b243bed02f5e59090cc58dac77bbf3.tar.gz
rails-c1a1595740b243bed02f5e59090cc58dac77bbf3.tar.bz2
rails-c1a1595740b243bed02f5e59090cc58dac77bbf3.zip
Merge pull request #22967 from schneems/schneems/generic-metadata
Prevent destructive action on production database
Diffstat (limited to 'activerecord/lib/active_record/model_schema.rb')
-rw-r--r--activerecord/lib/active_record/model_schema.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/model_schema.rb b/activerecord/lib/active_record/model_schema.rb
index a6a68f3d4b..f26c8471bc 100644
--- a/activerecord/lib/active_record/model_schema.rb
+++ b/activerecord/lib/active_record/model_schema.rb
@@ -44,6 +44,19 @@ module ActiveRecord
##
# :singleton-method:
+ # Accessor for the name of the internal metadata table. By default, the value is "active_record_internal_metadatas"
+ class_attribute :internal_metadata_table_name, instance_accessor: false
+ self.internal_metadata_table_name = "active_record_internal_metadatas"
+
+ ##
+ # :singleton-method:
+ # Accessor for an array of names of environments where destructive actions should be prohibited. By default,
+ # the value is ["production"]
+ class_attribute :protected_environments, instance_accessor: false
+ self.protected_environments = ["production"]
+
+ ##
+ # :singleton-method:
# Indicates whether table names should be the pluralized versions of the corresponding class names.
# If true, the default table name for a Product class will be +products+. If false, it would just be +product+.
# See table_name for the full rules on table/class naming. This is true, by default.