Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge pull request #13 from maxsum-corin/master

Wrong quotes in field_exists? for sqlserver
  • Loading branch information...
commit febf85b333e7bbc8dad36642968e914b71fee8ce 2 parents b59e6b6 + 8e55945
Piotr Solnica authored September 14, 2011
4  lib/dm-migrations/adapters/dm-sqlserver-adapter.rb
@@ -22,8 +22,8 @@ def storage_exists?(storage_name)
22 22
 
23 23
       # @api semipublic
24 24
       def field_exists?(storage_name, field_name)
25  
-        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
26  
-        result ? result.field == field_name : false
  25
+        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
  26
+        result ? result.to_s == field_name.to_s : false
27 27
       end
28 28
 
29 29
       module SQL #:nodoc:

0 notes on commit febf85b

Please sign in to comment.
Something went wrong with that request. Please try again.