« Programming Erlang is Shipping | Main | Possibly my favorite Rake target »

July 21, 2007

Advanced Ruby and the Rails Edge

864885841_c6def3b9b2
I just got back from Reston, VA, where Chad Fowler and I gave the very first Advanced Ruby Studio. It was a blast. Both Chad and I came away exhausted; we went through a lot of material (from low-level interpreter data structures, through the true meaning of self, to design principles in dynamic languages). This first Studio sold out, but I believe there are still a few seats open for the one in Denver in November.

Between now and then, I'm really looking forward to meeting up with old friends (and making some new ones) at the next Rails Edge. I really liked RailsConf in Portland, but it was clearly a big conference. The Edge has a very different feel: it's far more intimate, so attendees and speakers all get to know each other through the three days. And, as a speaker, I find that invaluable, because that's where I learn what's really going on. If you haven't been to an Edge before, and you'd like to learn the latest in Rails from the world's experts (and me), I'd recommend checking it out.

(Oh, and if you are going, be sure to sign up for Jen's half-day Web Design for Rails Developers. Despite the fact that I'm a lost cause when it comes to design, I'll be there.)

TrackBack

TrackBack URL for this entry:
http://www.typepad.com/t/trackback/2226312/20235514

Listed below are links to weblogs that reference Advanced Ruby and the Rails Edge:

Comments

Dave,

You are not a lost design cause. You have a good eye and, more importantly, good analytical skills.

Looking forward to August.

;o)

p.s. You just might find me in the Nov. Advanced Ruby class...

Wish I had been at the session! I might have asked why "Agile Web Development with Rails" does not include the term "Stored procedure" anywhere :) I am right now dealing with a fairly hairy legacy database (Sql server no less), and my neophyte ruby status isnt helping me solve some of the relationship issues. nested XREF's, etc. I am almost ready to give up on active record and try rbatis... with all the stored procedures and views in the database, i am having a hard time deciding what to create models for....

AWDwR doesn't mention it because DHH doesn't believe in them, and therefore Active Record doesn't really support them. There are database specific hacks, but they're ugly.

The book documents the framework. FWIW, this is something that I personally wish Rails supported.


Dave

What we've done with our legacy Oracle databases is just treat views like read-only tables, so they get an A/R class. For stored procedures we found some OCI-specific ways to call them, and put that code in particular methods in the A/R model class, so calling it from the rest of the app at least is pretty clean, and the db-specific code stays in the model where it belongs.

I'd suggest first figuring out how to call a SQL Server stored procedure in a plain ruby script using whatever database driver you'll use in Rails, so you're just working with that. Then bring the code into Rails, give it a connection from ActiveRecord (so it uses your rails app's existing connection) and you should have it.

Post a comment

If you have a TypeKey or TypePad account, please Sign In

Now in Beta

  • Programming Ruby, 3rd Edition
    Third Edition, Covering Ruby 1.9, now in beta
My Photo

Pragmatic Stuff

Photos

  • www.flickr.com
    This is a Flickr badge showing public photos from pragdave tagged with pragdave_badge. Make your own badge here.

Site Search

  • Google Search

    The web
    PragDave