Read my latest article: 8 things I look for in a Ruby on Rails app (posted Thu, 06 Jul 2017 17:59:00 GMT)

Portland Ruby Brigade meets CD Baby

Posted by Wed, 05 Oct 2005 05:25:00 GMT

This is what happened to the Portland Ruby Brigade today:
  • Got double booked on meeting night with the PHP group
  • Got asked to leave after getting threats of the lights being turned off
  • Stayed almost til closing time at a brew… we heard, “Last Call!” and still continued talking…

Tonight I finally got to meet Ben, Caleb, Justin Watkins, Marcus Estes, Lennon Day-Reynolds, Jeremy Kempter (bitsweat), Aaron Johnson, and Peat Bakke-each for the first time. I also got to see Scott Laird (of Typo fame) and John Labovitz again. Scott and I met at FOSCON and John once found me when he was trying to hack people at a coffee shop and saw that I was on the wireless network. Okay, he wasn’t hacking… but found me at Urban Grind. :)

We had about ~25 people show up. I don’t think that there was a head count made. We sat around in a big circle and fired questions at both Derek Sivers and Jeremy Kemper. Topics ranged from how Derek found his way to PostgreSQL to why he thinks that he is an amazing web designer (smirk) to why Ruby and Rails was picked as the platform to move to from a PHP/MySQL system. Jeremy shared some insights into some problems with Rails that need to be worked on (boolean-stuff for example), tips on debugging, and many other things that I don’t recall off the top of my head.

It was a very relaxed and open conversation with some cool local developers who are working on getting their Rails/PostgreSQL system finished.

After we got kicked out of FreeGeek most of migrated to the Lucky Lab Pub… and then we realized that Derek and Jeremy didn’t show up. So, we found our ways to a big table and broke up into smaller conversations. I got stuck at the table with Ben, Scott, Caleb, and John. Actually, it was quite enjoyable. Scott talked about his work with Typo and Ben and I gave him some of our thoughts on things.

This is a horrible summary of the whole evening. It’s what I remember… and it’s late and I look forward to getting to hang out with this gang again in the future. I think that it was great to get to finally meet a few of the people that I have worked on some smaller projects with. If everything works out well, expect there to be some more projects coming out of the PDX.rb in the coming months. :-)

Thanks again to Derek Sivers and Jeremy Kemper for taking time out of their busy schedule to meet & greet with the Portland Ruby people. :-)

Master, console, and servant part two

Posted by Tue, 04 Oct 2005 04:54:00 GMT

This is a brief addition to the post from a few days ago, Master, console, and servant.

Noradio on IRC pointed out one thing that I did not mention in my previous blog entry… that you can bind a subsession of irb to a specific object. What??

Okay, let me explain this a bit more. Instead of always setting a variable to hold an instance of an object, you can be a bit more creative with irb.

I present…

So, for example. You can perform the following in script/console.

irb Model.find(4) name

If there is an attribute/method called name in your model, then it will call it there. See my screen shot for some more details of how I used the jobs and fg # commands to switch jobs…. and I even found out what happens when you attempt to switch to the current thread. :-)

Until next time…

Master, console, and servant

Posted by Sun, 02 Oct 2005 01:47:00 GMT

I love console in Rails. It is absolutely one of my favorite tools in Rails. I probably spend more time testing stuff in console than I do in a browser, which is a good thing. Right?

Today, I was reading through a part of Programming Ruby (I like to open up to a random page and read something every once in a while) and came across a section on page 189. Subsessions and Bindings I was not aware that I could do this within irb and immediately thought to myself, “can I do that with console?” Console is afterall…just irb with all the Rails features pre-configured. So, I decided that I would try this out the next time I was in console.

That time came and passed… so, does it work?

The answer: YES!

I even have proof… :-)

This should eliminate a few tabs in iterm for me and works just like the Unix jobs and fg commands do.

If you are still not using console yet, why?

Perhaps you enjoy the pain of constant browser reloads because you keep trying to figure out if that method works. Often times, you can copy and paste your code right into console. It’s beautiful and gives you a quicker response than your browser will ever. But, you already knew that. Right?

Don’t get me wrong, I can totally understand your justifications for the extra pain. Who wants to work in their terminal more than they have to? (I do… but I do it because I am at home in my terminal.) There is nothing pretty about the terminal… but I feel in control. Are you a servant of your pretty GUI IDE and browser or are you the master of your terminal? ;-)

Okay, I will end this nonsense with my new console marketing campaign. I have employeed three pigeons to help me work on this one and the end result of our hard work?

Have you ruby script/console‘d today?

Yes. Classy and Original. :-)

Back to writing…

The bitter-sweet taste of agnostic database schemas

Posted by Tue, 27 Sep 2005 13:41:00 GMT

If you know me at all by now… you might know that I am a huge fan of PostgreSQL. Coming to the Rails camp was a bit of an eye-opener./ Working with PostgreSQL used to save me quite a bit of work and let me sleep at night. I have dealt with the problems that many developers face while working with MySQL. Like many of us in the Open Source world, I was exposed to MySQL more often than PostgreSQL. For several years, I convinced myself that MySQL was awesome because it was fast… but speed isn’t always the most important factor in the technology world. Otherwise, we’d all be coding in C. What PostgreSQL provided to me as a developer was better relational integrity. Foo cannot exist unless Bar does, or vice versa. ON DELETE CASCADE was a godsend and saved me quite a bit of work when building an application. Triggers… Procedural Languages… oh so beautiful.

PostgreSQL was (and is) the Open Source database server that both the Enterprise DBA and Developer could agree on.

Enter Ruby on Rails

At first, I just ignored my instincts and jumped in head first. Pluralization? Primary keys named id? Blasphemy! Yet, I moved forward. After a few days of consistently reminding myself of these new-fangled conventions (I even printed out a little cheat sheet and taped it to my monitor)... I was hooked. Rails worked with PostgreSQL. Let me say that again.


Don’t freak out. Yes, the person who started the Rails project is a MySQL fan... but Rails is database agnostic. It’s true.

I wanted to write an entry to clear up a few myths about Rails.

  • Table names are not forced
  • Primary Key field names are not forced
  • Foriegn Key field names are not forced
  • Legacy databases can work with Rails
  • Active Record (like much of Rails) can be customized for your particular application’s needs

I was, and still am, concerned about trusting Active Record with handling my relational data… because in some cases it wasn’t doing what it should. But, that is being worked on… and because Rails is Open Source, the issue is transparent for us developers to see and help fix.

In the past, you might have found me advocating the addition of business logic in your database server, whenever possible. It is the gate keeper. The key master. It is not meant to be flexible with your data. If business rules are to change, you change them there so that if you have one or more INPUT streams into your database, the data will not get into your server unless your business rules are met. PostgreSQL even provides you with a nice ERROR message, which some other servers do not. If you can control everything through one INPUT stream (Application Database), then putting these constraints solely in your database abstraction layer is a-ok. However, if you are interfacing with your server through a variety of avenues (Integration Database), you probably already know that your system is going to be a pain to maintain in the long run. So, what are you to do?

Handling Legacy systems is going to be a headache, regardless of what you do… but you can’t always rebuild the whole thing and migrate your data. Add that to your Someday-Maybe list.

When you’re adding new pieces to your application, start by using good tools, frameworks, and practices. For example, try your best to follow the Application Database path to pragmatic enlightenment. Begin working on a new layer for your legacy database. Add on web services that use this layer. Refactor your existing applications. Can they use these new services? ReThink everything. That is… if you have the time and resources to do so.

If you are questioning whether or not to put your business logic in your database abstraction layer, stop. Just do it™. But, do it with caution. Test it. Test it well. I’ll admit that I still add some constraints into my database schemas-I am not ready to give up that extra layer of data security. But, that’s just me. :)

PostgreSQL works with Rails!

...and I promise to show you how to do some fun legacy stuff with Rails in my book. :-)

Hurricane shelter uses Rails and PostgreSQL, thanks open source

Posted by Sat, 24 Sep 2005 12:45:00 GMT

I came across this weblog entry on a website that is offering shelter for victims of Hurricane Katrina.

The author writes:
How do you measure the ROI on a project like this? How do I get PostgreSQL or Ruby-on-Rails credit for reuniting a twelve year-old girl with her father who had been missing for three weeks or any of the other amazing stories we heard everyday at Windsor?

It’s great to hear that Open Source is used for situations like this. The money that would have been spent on commercial applications and support would be better spent on the people that they are trying to help.

I tried to figure out exactly which page might be using Rails (as they are using Gallery, WordPress, etc for a few other pieces of their system). I found this, which looks like it might be based in Rails.

Disclaimer I couldn’t find too much information about this, just their blog and a few links from it. If you find more information, please comment and I’ll update this entry. :-)


I got an email from Rudi Cilibrasi from Katrina Help. They are using Ruby on Rails for their people search.

CDBaby Q&A at next Portland Ruby Brigade meeting

Posted by Fri, 23 Sep 2005 20:06:00 GMT

I just posted on the Portland Ruby Brigade blog that Derek Sivers and Jeremy Kemper (bitsweat) will be coming to the next PDX.rb user group meeting. Derek and Jeremy will field questions from all of us in regards to their complete rewrite of CD Baby from PHP+MySQL to Ruby+Rails+PostgreSQL. (my favorite open-source projects!)

This will take place at FreeGeek in Portland, Oregon on October 4th, 2005!

For more information, see the Portland Ruby Brigade website

Older posts: 1 ... 23 24 25 26 27