NetManiac

Witold Rugowski on web20 wave with Ruby on Rails

Column names restrictions

Posted on May 26, 2006 - Filed Under Ruby

Last update – 2006-05-30

Ruby on Rails praises convention over configuration. Nice, but You have to be aware of this conventions, or You may run into troubles. Let’s take DB column names. RoR makes many assumptions about them, allowing this way many magic things happen.

Currently I’m aware of following conventions:

I was not aware about type column, and doing application for import scan results from Nessus I ran on following error:

SyntaxError ((eval):1:in `compute_type': compile error
(eval):1: parse error, unexpected tINTEGER
Object::0

It was caused by type column, since DB structure was tailored to match Nessus export to SQL file, which was using such a column.

Columns named created_on and updated_at are automagically set for record creation date and update time respectively

Popularity: 5% [?]

Hits for this post: 5231

Similar Posts

Comments

One Response to “Column names restrictions”

  1. 向左走,向右走。。。 on September 15th, 2006 15:20

    links from Technorati_on for date fieldsuffix _id for reference to other tablecolumn type single table inheritance (see: RoR Wiki)dont use sessions table in DB (or don’t use code generated by scaffold) details explained http://nhw.pl/wp/2006/05/30/dont-use-sessions-table-in-rails I was not aware about type column, and doing application for import scan results from Nessus I ran on following error: SyntaxError ((eval):1:in `compute_type’: compile error (eval):1: parse error, unexpected tINTEGER

  2. dunton on June 11th, 2006 17:11

    I’m love this great website. Many thanks guy

Leave a Reply