mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Merge pull request #14973 from kuldeepaggarwal/f-refactor
Convert column name to string only once
This commit is contained in:
commit
af6816110a
1 changed files with 2 additions and 1 deletions
|
@ -71,7 +71,8 @@ module ActiveRecord
|
|||
# column_exists?(:suppliers, :tax, :decimal, precision: 8, scale: 2)
|
||||
#
|
||||
def column_exists?(table_name, column_name, type = nil, options = {})
|
||||
columns(table_name).any?{ |c| c.name == column_name.to_s &&
|
||||
column_name = column_name.to_s
|
||||
columns(table_name).any?{ |c| c.name == column_name &&
|
||||
(!type || c.type == type) &&
|
||||
(!options.key?(:limit) || c.limit == options[:limit]) &&
|
||||
(!options.key?(:precision) || c.precision == options[:precision]) &&
|
||||
|
|
Loading…
Reference in a new issue