From 030685854a7876130595b630c283fbba7265660e Mon Sep 17 00:00:00 2001 From: hatsu38 Date: Mon, 8 Jul 2024 12:35:33 +0900 Subject: [PATCH] refactor: change to map(&:name) --- lib/active_hash/base.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/active_hash/base.rb b/lib/active_hash/base.rb index 043d140..464fa44 100644 --- a/lib/active_hash/base.rb +++ b/lib/active_hash/base.rb @@ -64,9 +64,7 @@ def field_names # # => ["id", "name", "code"] # def column_names - field_names.map do |field| - field.respond_to?(:name) ? field.name : field.to_s.freeze - end + field_names.map(&:name) end def the_meta_class