Permalink
Browse files

Merge pull request #13 from maxsum-corin/master

Wrong quotes in field_exists? for sqlserver
  • Loading branch information...
2 parents b59e6b6 + 8e55945 commit febf85b333e7bbc8dad36642968e914b71fee8ce @solnic solnic committed Sep 14, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/dm-migrations/adapters/dm-sqlserver-adapter.rb
@@ -22,8 +22,8 @@ def storage_exists?(storage_name)
# @api semipublic
def field_exists?(storage_name, field_name)
- result = select("SELECT c.name FROM sysobjects as o JOIN syscolumns AS c ON o.id = c.id WHERE o.name = #{quote_name(storage_name)} AND c.name LIKE ?", field_name).first
- result ? result.field == field_name : false
+ result = select("SELECT c.name FROM sysobjects as o JOIN syscolumns AS c ON o.id = c.id WHERE o.name = ? AND c.name LIKE ?", storage_name, field_name).first
+ result ? result.to_s == field_name.to_s : false
end
module SQL #:nodoc:

0 comments on commit febf85b

Please sign in to comment.