Archive for the ‘key’ Category

Rails not respecting primary keys

Wednesday, April 18th, 2007

There is some issue with Ruby on Rails not respecting primary key and other settings on columns when it does a schema dump of the db. It does this when you use a non-standard id column e.g. tablename_id and not just id.

There is a patch floating about that fixes this but a simpler way is to uncomment config.active_record.schema_format = :sql in your environment.rb. It then uses SQL and not Ruby for your schema and it respects your databases.

MacBook Pro Diaries #003: Hash

Thursday, September 7th, 2006

Since I do a lot of Ruby and CSS coding I need the # character a rather lot. It took me a few minutes to figure it out as it is not marked on the keyboard at all. All the chatter on the web says to use Alt+3 but that produces a £ character for me.

Shift+3 does the trick. Long live hash!

Key/value tags

Friday, August 18th, 2006

In a previous post I mentioned ActionTags. Along those lines I’d like to see tagging systems support “key/value pairs.” This is a familiar concept to any programmer. Basically you have a table in your database that can store an ad-hoc set of data. Anything that doesn’t fit into your other tables or is not worth creating a distinct model for. e.g. application settings. You identify the value with a key and that can be easily retrieved.

JSON is a key/value pair system really (except that values can be structures themselves.)

When it comes to tagging key/value pairs would work well and provide some distinct meaning to tags. You could have fruit:orange with the key being fruit and the value being orange in that case. colour:orange is then distinct from fruit:orange.

I was thinking of this because I am doing some “open CMS” research at work and wanted to save my Blinklist links into a collection related to the research. At first I thought of providing a unique tag for this, e.g. researchproj001 or something convoluted like that. It struck me though that simply doing collection:Project Name works well. Blinklist and I assume other systems allow the colon and so support this already. But they need a bit more work to make it completely usable. I don’t want to loose the tag inside the value of the key/value pair. e.g. if I tagged a link as collection:Bubble Project I wouldn’t be able to show a list of links with that tag “Bubble Project.” I’d have to use the whole k/v of collection:Bubble Project as Blinklist treats it as one tag.

So, some sort of key/value pair support in tagging systems, please.