Skip to content

Commit

Permalink
Convert column name to string only once
Browse files Browse the repository at this point in the history
  • Loading branch information
kuldeepaggarwal committed May 4, 2014
1 parent 9b2b36f commit 5e80313
Showing 1 changed file with 2 additions and 1 deletion.
Expand Up @@ -71,7 +71,8 @@ def columns(table_name) end
# 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]) &&
Expand Down

0 comments on commit 5e80313

Please sign in to comment.