aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2018-06-26 10:24:01 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2018-06-26 10:24:01 -0700
commit259bf87560aa556734f4f8ab16a99c4237872b20 (patch)
tree7c7d45393505ba7b7df5b4d13ae68182c1a1cb2b /activerecord/lib/active_record
parent7d58fa87ef27712fc3dcd5a098d751a67563c9de (diff)
parent7c769234f6070e9dcc17f92d448e770358dd57e4 (diff)
downloadrails-259bf87560aa556734f4f8ab16a99c4237872b20.tar.gz
rails-259bf87560aa556734f4f8ab16a99c4237872b20.tar.bz2
rails-259bf87560aa556734f4f8ab16a99c4237872b20.zip
Merge branch 'master' into homogeneous-allocation
* master: Call initialize after allocate Remove `ActiveSupport::Concern` from `ActiveRecord::Aggregations` Add example for no_touching? in active_record/no_touching for api docs [ci skip] Generate a new key for each service test
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r--activerecord/lib/active_record/aggregations.rb2
-rw-r--r--activerecord/lib/active_record/core.rb5
-rw-r--r--activerecord/lib/active_record/no_touching.rb7
3 files changed, 7 insertions, 7 deletions
diff --git a/activerecord/lib/active_record/aggregations.rb b/activerecord/lib/active_record/aggregations.rb
index 7286837ac7..3250e29b82 100644
--- a/activerecord/lib/active_record/aggregations.rb
+++ b/activerecord/lib/active_record/aggregations.rb
@@ -3,8 +3,6 @@
module ActiveRecord
# See ActiveRecord::Aggregations::ClassMethods for documentation
module Aggregations
- extend ActiveSupport::Concern
-
def initialize_dup(*) # :nodoc:
@aggregation_cache = {}
super
diff --git a/activerecord/lib/active_record/core.rb b/activerecord/lib/active_record/core.rb
index 9c9fc77a0d..20d9e7a9ca 100644
--- a/activerecord/lib/active_record/core.rb
+++ b/activerecord/lib/active_record/core.rb
@@ -139,11 +139,6 @@ module ActiveRecord
end
module ClassMethods # :nodoc:
- def allocate
- define_attribute_methods
- super
- end
-
def initialize_find_by_cache # :nodoc:
@find_by_statement_cache = { true => Concurrent::Map.new, false => Concurrent::Map.new }
end
diff --git a/activerecord/lib/active_record/no_touching.rb b/activerecord/lib/active_record/no_touching.rb
index 754c891884..697076bdae 100644
--- a/activerecord/lib/active_record/no_touching.rb
+++ b/activerecord/lib/active_record/no_touching.rb
@@ -43,6 +43,13 @@ module ActiveRecord
end
end
+ # Returns +true+ if the class has +no_touching+ set, +false+ otherwise.
+ #
+ # Project.no_touching do
+ # Project.first.no_touching? # true
+ # Message.first.no_touching? # false
+ # end
+ #
def no_touching?
NoTouching.applied_to?(self.class)
end