New to Ruby on Rails.. Database Relations?


#1

I’ve been devloping in Coldfusion for the last 3-4 years… I’m looking
into Ruby on Rails and was wonding how I can join tables in my database.
Also, if I delete a Ex. Post, how can I make sure it deletes the
comments…?

Thank in Advance…

I’m sure it something easy, just lost in a new world…


#2

I’ve been devloping in Coldfusion for the last 3-4 years…
I’m looking into Ruby on Rails and was wonding how I can join
tables in my database.

Look at the :includes option for the finder methods of
ActiveRecord::Base.

Alternately, you can always invoke manual SQL queries with find_by_sql.

Also, if I delete a Ex. Post, how can I make sure it deletes
the comments…?

See :dependent=>:destroy in ActiveRecord::Base to do it in rails; you
could also tell your database to do it on_delete if your database
permits.

  • donald

#3

Ball, Donald A Jr (Library) wrote:

I’ve been devloping in Coldfusion for the last 3-4 years…
I’m looking into Ruby on Rails and was wonding how I can join
tables in my database.

Look at the :includes option for the finder methods of
ActiveRecord::Base.

Alternately, you can always invoke manual SQL queries with find_by_sql.

Also, if I delete a Ex. Post, how can I make sure it deletes
the comments…?

See :dependent=>:destroy in ActiveRecord::Base to do it in rails; you
could also tell your database to do it on_delete if your database
permits.

  • donald

Ok, I should have specified… I’m really new! I did not understand
anything you just said… Obviously I need to look into the ruby
language…