I have an application running on SQLServer 2005,
recently I ran into a problem.
object.blank? catches 'nil' and empty values but it fails to recognize 'NULL' values returned from activerecord results.
Is there a way in ruby to detect database NULL values?
rails changes nil to null before saving and also for retrieving from database it changes null to nil. I think you might be storing null as a string and this causing an issue for you.
While googling this issue, I found the "Article":http://thisoldcoder.com/
This fix seems to solve my problem.
Would like to hear comments on this fix?
What about a real string value "NULL" inputted by end user?
I don't think that is a good solution. IMP, it should be the adapter's matter. That means we should catch it by recognizing the column attributes (type?) and then replace the value.