aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorRafael França <rafaelmfranca@gmail.com>2017-03-20 14:21:04 -0400
committerGitHub <noreply@github.com>2017-03-20 14:21:04 -0400
commiteeb8c3c246bd0c8bbf95b555efcec9fcb19cc3c6 (patch)
tree9ffae421c7040fe56c7e340263a86dca3decab48 /activerecord
parentfee4257f8d4c389e5d6abb9af39dbed89994d86b (diff)
parentfdc3e789b5dada526f530969308e24874b9b1986 (diff)
downloadrails-eeb8c3c246bd0c8bbf95b555efcec9fcb19cc3c6.tar.gz
rails-eeb8c3c246bd0c8bbf95b555efcec9fcb19cc3c6.tar.bz2
rails-eeb8c3c246bd0c8bbf95b555efcec9fcb19cc3c6.zip
Merge pull request #28487 from kamipo/remove_duplicated_columns_definition
Remove duplicated `columns` definition
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb8
-rw-r--r--activerecord/lib/active_record/connection_adapters/abstract_adapter.rb8
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?