From 402852fc6d3222a283b65d407ffec3161946db71 Mon Sep 17 00:00:00 2001 From: Ryuta Kamizono Date: Fri, 26 Aug 2016 02:07:44 +0900 Subject: Add `Type.default_value` and use it everywhere for internal For reduce instantiating `Type::Value`. --- activerecord/lib/active_record/type.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'activerecord/lib/active_record/type.rb') diff --git a/activerecord/lib/active_record/type.rb b/activerecord/lib/active_record/type.rb index 1b2fc1b034..0b48d2186a 100644 --- a/activerecord/lib/active_record/type.rb +++ b/activerecord/lib/active_record/type.rb @@ -37,6 +37,10 @@ module ActiveRecord registry.lookup(*args, adapter: adapter, **kwargs) end + def default_value # :nodoc: + @default_value ||= Value.new + end + private def current_adapter_name -- cgit v1.2.3