Skip to content

Commit

Permalink
Merge pull request #4850 from smartinez87/useless_arg
Browse files Browse the repository at this point in the history
Remove useless argument in #columns.
  • Loading branch information
tenderlove committed Feb 2, 2012
2 parents 3ccbc61 + dcd74eb commit 215a390
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def index_exists?(table_name, column_name, options = {})

# Returns an array of Column objects for the table specified by +table_name+.
# See the concrete implementation for details on the expected parameter values.
def columns(table_name, name = nil) end
def columns(table_name) end

# Checks to see if a column exists in a given table.
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ def indexes(table_name, name = nil) #:nodoc:
end

# Returns an array of +Column+ objects for the table specified by +table_name+.
def columns(table_name, name = nil)#:nodoc:
def columns(table_name)#:nodoc:
sql = "SHOW FULL FIELDS FROM #{quote_table_name(table_name)}"
execute_and_free(sql, 'SCHEMA') do |result|
each_hash(result).map do |field|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -891,7 +891,7 @@ def indexes(table_name, name = nil)
end

# Returns the list of all column definitions for a table.
def columns(table_name, name = nil)
def columns(table_name)
# Limit, precision, and scale are all handled by the superclass.
column_definitions(table_name).collect do |column_name, type, default, notnull|
PostgreSQLColumn.new(column_name, default, type, notnull == 'f')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ def table_exists?(name)
end

# Returns an array of +SQLiteColumn+ objects for the table specified by +table_name+.
def columns(table_name, name = nil) #:nodoc:
def columns(table_name) #:nodoc:
table_structure(table_name).map do |field|
case field["dflt_value"]
when /^null$/i
Expand Down
4 changes: 2 additions & 2 deletions activerecord/lib/active_record/reflection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,8 @@ def counter_cache_column
end
end

def columns(tbl_name, log_msg)
@columns ||= klass.connection.columns(tbl_name, log_msg)
def columns(tbl_name)
@columns ||= klass.connection.columns(tbl_name)
end

def reset_column_information
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def merge_column(table_name, name, sql_type = nil, options = {})
options[:null])
end

def columns(table_name, message)
def columns(table_name)
@columns[table_name]
end
end
Expand Down

0 comments on commit 215a390

Please sign in to comment.