diff options
author | PareshGupta <paresh@vinsol.com> | 2016-02-02 11:21:52 +0530 |
---|---|---|
committer | PareshGupta <paresh@vinsol.com> | 2016-02-02 11:21:52 +0530 |
commit | e944e67001a1bebd1f7305f5b30f5ae9361ecb28 (patch) | |
tree | 1011f332b9487143494d64f0243479ce011554ad /activerecord/lib/active_record | |
parent | d8ac525059a6d389bcb7a0615e97683456ac4be0 (diff) | |
download | rails-e944e67001a1bebd1f7305f5b30f5ae9361ecb28.tar.gz rails-e944e67001a1bebd1f7305f5b30f5ae9361ecb28.tar.bz2 rails-e944e67001a1bebd1f7305f5b30f5ae9361ecb28.zip |
Remove unused class AttributeMethodCache
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/attribute_methods.rb | 24 | ||||
-rw-r--r-- | activerecord/lib/active_record/attribute_methods/read.rb | 1 |
2 files changed, 0 insertions, 25 deletions
diff --git a/activerecord/lib/active_record/attribute_methods.rb b/activerecord/lib/active_record/attribute_methods.rb index 423a93964e..e902eb7531 100644 --- a/activerecord/lib/active_record/attribute_methods.rb +++ b/activerecord/lib/active_record/attribute_methods.rb @@ -34,30 +34,6 @@ module ActiveRecord BLACKLISTED_CLASS_METHODS = %w(private public protected allocate new name parent superclass) - class AttributeMethodCache - def initialize - @module = Module.new - @method_cache = Concurrent::Map.new - end - - def [](name) - @method_cache.compute_if_absent(name) do - safe_name = name.unpack('h*'.freeze).first - temp_method = "__temp__#{safe_name}" - ActiveRecord::AttributeMethods::AttrNames.set_name_cache safe_name, name - @module.module_eval method_body(temp_method, safe_name), __FILE__, __LINE__ - @module.instance_method temp_method - end - end - - private - - # Override this method in the subclasses for method body. - def method_body(method_name, const_name) - raise NotImplementedError, "Subclasses must implement a method_body(method_name, const_name) method." - end - end - class GeneratedAttributeMethods < Module; end # :nodoc: module ClassMethods diff --git a/activerecord/lib/active_record/attribute_methods/read.rb b/activerecord/lib/active_record/attribute_methods/read.rb index 56b87e8933..ab2ecaa7c5 100644 --- a/activerecord/lib/active_record/attribute_methods/read.rb +++ b/activerecord/lib/active_record/attribute_methods/read.rb @@ -1,7 +1,6 @@ module ActiveRecord module AttributeMethods module Read - extend ActiveSupport::Concern module ClassMethods |