diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2016-08-26 02:07:44 +0900 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2016-08-26 02:14:06 +0900 |
commit | 402852fc6d3222a283b65d407ffec3161946db71 (patch) | |
tree | 24424c8f27c12d2ff3a53a602373cafb65969f56 /activerecord/lib/active_record/type.rb | |
parent | 804f5b3c2af90b69a51209c56739a077f3fb632b (diff) | |
download | rails-402852fc6d3222a283b65d407ffec3161946db71.tar.gz rails-402852fc6d3222a283b65d407ffec3161946db71.tar.bz2 rails-402852fc6d3222a283b65d407ffec3161946db71.zip |
Add `Type.default_value` and use it everywhere for internal
For reduce instantiating `Type::Value`.
Diffstat (limited to 'activerecord/lib/active_record/type.rb')
-rw-r--r-- | activerecord/lib/active_record/type.rb | 4 |
1 files changed, 4 insertions, 0 deletions
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 |