The Artima Developer Community
Sponsored Link

Agile Buzz Forum
Tips for Writing a Ruby On Rails Database Adapter

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Jared Richardson

Posts: 1031
Nickname: jaredr
Registered: Jun, 2005

Jared Richardson is an author, speaker, and consultant who enjoys working with Ruby and Rails.
Tips for Writing a Ruby On Rails Database Adapter Posted: Apr 20, 2006 7:19 PM
Reply to this message Reply

This post originated from an RSS feed registered with Agile Buzz by Jared Richardson.
Original Post: Tips for Writing a Ruby On Rails Database Adapter
Feed Title: Jared's Weblog
Feed URL: http://www.jaredrichardson.net/blog/index.rss
Feed Description: Jared's weblog. The web site was created after the launch of the book "Ship It!" and discusses issues from Continuous Integration to web hosting providers.
Latest Agile Buzz Posts
Latest Agile Buzz Posts by Jared Richardson
Latest Posts From Jared's Weblog

Advertisement

I've been working on a Ruby database driver for Ingres. Most of the work has been in C, but I finally have my Ruby code (via C) fetching data from the database.

Now I'm starting on the Ruby on Rails portion. It involves adding a lot of additional calls that I didn't have in place. It's actually a pretty big test suite to get your head around. I'm sure it'll be simple once I understand it all. :)

I met Mike Laster at a local Ruby meetup. He's writing a Rails adapter too (small world!) and he's been giving me a few hints. I thought I'd pass on a few of them.

Build against the stable version first so you don't have a moving target. Once you pass 100% of the tests, then work on integrating it into the trunk code.

When you run the unit tests, it is easier during development to focus on one unit test at a time instead of getting flooded with thousands of errors at a time.

The trick I use is:

- Change to the rails/activerecord/test directory
- run "ruby -I "connections/native_frontbase" adapter_test.rb -v

adapter_test.rb seems to be a good one to start with. If it doesn't pass 100% there is no hope of any other test functioning.

The first few that I remember needing to pass were:
adapter_test
base_test
pk_test
finder_test

The other tests tend to fall into place once these are working.

Hopefully this will help out a few other people as well.

Enjoy!

Jared

Read: Tips for Writing a Ruby On Rails Database Adapter

Topic: Smalltalk and Spirits on Sunday Evening Previous Topic   Next Topic Topic: Smalltalk Solutions Update: April 16, 2006

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use