aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/timestamp.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/timestamp.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/timestamp.rb')
-rw-r--r--activerecord/lib/active_record/timestamp.rb3
1 files changed, 1 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/timestamp.rb b/activerecord/lib/active_record/timestamp.rb
index 09d8d1cdd4..55f3a194a9 100644
--- a/activerecord/lib/active_record/timestamp.rb
+++ b/activerecord/lib/active_record/timestamp.rb
@@ -43,8 +43,7 @@ module ActiveRecord
extend ActiveSupport::Concern
included do
- class_attribute :record_timestamps
- self.record_timestamps = true
+ class_attribute :record_timestamps, default: true
end
def initialize_dup(other) # :nodoc: