This post originated from an RSS feed registered with Ruby Buzz
by Robby Russell.
Original Post: DHH interviewed by O'Reilly
Feed Title: Robby on Rails
Feed URL: http://www.contegix.com/rss/feed.xml
Feed Description: My reflections on programming with Ruby, Rails, PostgreSQL... and learning how to run a business...
While reading it, I recalled a brief conversation that I had the other day, when someone said that they didn’t like Rails because, “it assumes things” which translated to the fact that they didn’t like that it had a uniform directory structure, pre-defined naming conventions, etc.
After spending this whole year, teaching myself Rails, reading the documentation pages… (probably at the API site a few hours a day), this concerned me. A lot of people are quickly turned off by the fact that Rails has opinions. But, let’s think about this for a moment. Rails has opinions built-in that help speed up the development process when you accept those opinions. If you don’t, you don’t have to pspend any more time than you did prior to using Rails. So, their argument is, “why bother with Rails?”
At first, the answer isn’t so obvious…. but if you consider all the opinions that Rails expresses, do you honestly feel that every one of them is wrong? If so, Rails is probably not for you. If you find a good portion of them to be quality opinions, then… Rails just might be your cup of tea afterall.
Pluralization make you feel weird? Turn it off. (one line of code will do this for your whole application.
Wait, you want to use category_id as your primary key?
class Category < ActiveRecord::Base
set_primary_key "category_id"
end
Yes, I know… it’s tough. ;-)
Another thing that I am wondering now… what is the conductor?
My guess? Some added bonus for Rails that allows you to run a Rails application off of one or many servers… now that would be nice. That’s my guess though… what is yours?
set_primary_key is extremely useful for legacy databses. But when you come to test you program. Can you rename the primary key for the test environment? I think this is necessary, testing my application seems to completely fail, probably because of this. I can't see a work around.
You can rename the table name in the testing environment. set_fixture_class instead of set_table_name. except its kind of in reverse.