aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/inheritance.rb
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2017-05-29 18:01:50 +0200
committerGitHub <noreply@github.com>2017-05-29 18:01:50 +0200
commit1c275d812f35f53f93cd96184a4f319983766cc5 (patch)
treeb063afeb12dd369f358ad18517e5e8915455df0e /activerecord/lib/active_record/inheritance.rb
parentedc90c858d4cbf1a8e4bfb7347b34348bb30e92c (diff)
downloadrails-1c275d812f35f53f93cd96184a4f319983766cc5.tar.gz
rails-1c275d812f35f53f93cd96184a4f319983766cc5.tar.bz2
rails-1c275d812f35f53f93cd96184a4f319983766cc5.zip
Add option for class_attribute default (#29270)
* Allow a default value to be declared for class_attribute * Convert to using class_attribute default rather than explicit setter * Removed instance_accessor option by mistake * False is a valid default value * Documentation
Diffstat (limited to 'activerecord/lib/active_record/inheritance.rb')
-rw-r--r--activerecord/lib/active_record/inheritance.rb3
1 files changed, 1 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/inheritance.rb b/activerecord/lib/active_record/inheritance.rb
index 236a65eba7..5776807507 100644
--- a/activerecord/lib/active_record/inheritance.rb
+++ b/activerecord/lib/active_record/inheritance.rb
@@ -38,8 +38,7 @@ module ActiveRecord
included do
# Determines whether to store the full constant name including namespace when using STI.
# This is true, by default.
- class_attribute :store_full_sti_class, instance_writer: false
- self.store_full_sti_class = true
+ class_attribute :store_full_sti_class, instance_writer: false, default: true
end
module ClassMethods