Q:

Table has a column that contains a url to an image, but some rows don't, how to check for this?

I am creating a XML file of image urls, and I have to parse this URL when I am writing out the XML.
Some rows in the database don't have a URL, so how do I skip those rows and don't process?
Something like:
images = Image.limit(100)

images.each { |i|

  blah = ''

  if i.url ???
    # process stuff here
  else
      blah = ''
  end

}

A:

If it's a SQL database, I'd use a query that skipped rows with missing URLs:
 select * from database_table where url is not null

or something similar to that. Database queries differ depending on the database.
Otherwise, in Ruby I'd do something like:
if (i.url.any?)
    ...
else
    ...
end

or:
if (!i.url.empty?)...

