Your search for database returned 6 results.

Rails Single Table Inheritance Helper Module

Single table inheritance is a somewhat controversial topic in Rails land. For me, I like the Rails magic that it brings and, you know, the inheritance. However, it can clearly be abused. Here is my one rule for using Single table inheritance: (more…)

Read More

Quick Hit: Library not loaded: libmysqlclient.16.dylib

I haven't been using mysql much for my rails projects in favor of postgres, but in doing some tutorials on haml and sass I needed mysql in order to follow the tutorials exactly. After adding the mysql2 gem to my Gemfile, I got this error when running rake db:create: (more…)

Read More

My problem with Heroku

We've all been hearing a lot about Heroku lately. In fact, it seems that almost every rails blog has a post about how you "must use Heroku!' or you're an idiot to not using Heroku. Over the last month or so, I've been working on a project hosted on Heroku. Now this app has a lot of issues including code written by a billion developers that is often stupid or ...

Read More

Getting random rows from Sql Server

I'm working on a project where I want to return related content. The sproc I wrote seems to work ok but because I was sorting by the insert date or the title, it would always return the same thing for all content closely associated.So how do I get it to return only the closely related content AND randomize it?Here is the what I did: SELECT * FROM #tmpRelated ...

Read More

DBNull is my Nemisis: Part Deux

******This is the second part of my rant about DbNull. Go here to read the first part.******Ok. So now you have a utility method that lets you check for null whether it's null, DbNull, or, if bound to a datagrid, " "What if you want to Convert that object, which might be null or DbNull, to a Type? What if you'd like to write it in pretty code? Well then ...

Read More