diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2017-03-20 20:27:02 +0900 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2017-03-20 20:27:02 +0900 |
commit | fdc3e789b5dada526f530969308e24874b9b1986 (patch) | |
tree | 24966d0c490e2be58b19859f31d6848ef04a76cf /activerecord/lib/active_record/connection_adapters | |
parent | 1835d87fb848fd9f13e43bf16abd41be231b1666 (diff) | |
download | rails-fdc3e789b5dada526f530969308e24874b9b1986.tar.gz rails-fdc3e789b5dada526f530969308e24874b9b1986.tar.bz2 rails-fdc3e789b5dada526f530969308e24874b9b1986.zip |
Remove duplicated `columns` definition
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb | 8 | ||||
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract_adapter.rb | 8 |
2 files changed, 5 insertions, 11 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb index 1e826ff5ad..1cc10e3b93 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb @@ -105,10 +105,12 @@ module ActiveRecord indexes(table_name).any? { |i| checks.all? { |check| check[i] } } end - # Returns an array of Column objects for the table specified by +table_name+. - # See the concrete implementation for details on the expected parameter values. + # Returns an array of +Column+ objects for the table specified by +table_name+. def columns(table_name) - raise NotImplementedError, "#columns is not implemented" + table_name = table_name.to_s + column_definitions(table_name).map do |field| + new_column_from_field(table_name, field) + end end # Checks to see if a column exists in a given table. diff --git a/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb b/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb index ef1d9f81a9..b9fbcd05c7 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb @@ -162,14 +162,6 @@ module ActiveRecord SchemaCreation.new self end - # Returns an array of +Column+ objects for the table specified by +table_name+. - def columns(table_name) # :nodoc: - table_name = table_name.to_s - column_definitions(table_name).map do |field| - new_column_from_field(table_name, field) - end - end - # this method must only be called while holding connection pool's mutex def lease if in_use? |