From b57b23a37bda0a5534b12a539797a23792780d74 Mon Sep 17 00:00:00 2001 From: Ryuta Kamizono Date: Sat, 15 Jun 2019 23:50:45 +0900 Subject: Remove unused `Arel::Attributes.for` `Arel::Attributes.for` is no longer used since https://github.com/rails/arel/pull/196. --- activerecord/lib/arel/attributes.rb | 22 ---------------------- activerecord/lib/arel/visitors/to_sql.rb | 6 ------ 2 files changed, 28 deletions(-) delete mode 100644 activerecord/lib/arel/attributes.rb (limited to 'activerecord/lib/arel') diff --git a/activerecord/lib/arel/attributes.rb b/activerecord/lib/arel/attributes.rb deleted file mode 100644 index 35d586c948..0000000000 --- a/activerecord/lib/arel/attributes.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true - -require "arel/attributes/attribute" - -module Arel # :nodoc: all - module Attributes - ### - # Factory method to wrap a raw database +column+ to an Arel Attribute. - def self.for(column) - case column.type - when :string, :text, :binary then String - when :integer then Integer - when :float then Float - when :decimal then Decimal - when :date, :datetime, :timestamp, :time then Time - when :boolean then Boolean - else - Undefined - end - end - end -end diff --git a/activerecord/lib/arel/visitors/to_sql.rb b/activerecord/lib/arel/visitors/to_sql.rb index a1aa620f9d..eff7a0d036 100644 --- a/activerecord/lib/arel/visitors/to_sql.rb +++ b/activerecord/lib/arel/visitors/to_sql.rb @@ -689,12 +689,6 @@ module Arel # :nodoc: all join_name = o.relation.table_alias || o.relation.name collector << quote_table_name(join_name) << "." << quote_column_name(o.name) end - alias :visit_Arel_Attributes_Integer :visit_Arel_Attributes_Attribute - alias :visit_Arel_Attributes_Float :visit_Arel_Attributes_Attribute - alias :visit_Arel_Attributes_Decimal :visit_Arel_Attributes_Attribute - alias :visit_Arel_Attributes_String :visit_Arel_Attributes_Attribute - alias :visit_Arel_Attributes_Time :visit_Arel_Attributes_Attribute - alias :visit_Arel_Attributes_Boolean :visit_Arel_Attributes_Attribute def literal(o, collector); collector << o.to_s; end -- cgit v1.2.3