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/result.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/result.rb')
-rw-r--r-- | activerecord/lib/active_record/result.rb | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/result.rb b/activerecord/lib/active_record/result.rb index f5383f4c14..9ed70a9c2b 100644 --- a/activerecord/lib/active_record/result.rb +++ b/activerecord/lib/active_record/result.rb @@ -32,8 +32,6 @@ module ActiveRecord class Result include Enumerable - IDENTITY_TYPE = Type::Value.new # :nodoc: - attr_reader :columns, :rows, :column_types def initialize(columns, rows, column_types = {}) @@ -105,7 +103,7 @@ module ActiveRecord def column_type(name, type_overrides = {}) type_overrides.fetch(name) do - column_types.fetch(name, IDENTITY_TYPE) + column_types.fetch(name, Type.default_value) end end |