Forum: Ruby on Rails New to Ruby on Rails.. Database Relations?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
0f683a10396a224544944f9487fb239a?d=identicon&s=25 Nakirema (Guest)
on 2007-03-30 16:56
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...
E1f43bafda26307a050d11902752b2a6?d=identicon&s=25 Ball, Donald A Jr (Library) (Guest)
on 2007-03-30 17:02
(Received via mailing list)
> 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
0f683a10396a224544944f9487fb239a?d=identicon&s=25 Nakirema (Guest)
on 2007-03-30 17:13
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..
This topic is locked and can not be replied to.