Recent Posts

Heading to Portland for RailsConf... by foot

May 16, 2007

Yay! It’s almost conference time… and I’m almost completely thrilled!

Why am I not more thrilled? Well, mainly because RailsConf is being hosted here in Portland, which means that I don’t get to travel by train like we did last year via The Argon Express. (ah… the memories)

One perk of being here already… is that I get to act as a tour guide to visitors. For example, earlier today… Josh Susser (hasmanyjosh) joined Graeme and I for lunch in downtown Portland, OR. It was exciting to hear about how he and his fellow Rubyists at Powerset are using Ruby and Rails for various projects. John also spent a few minutes introducing us to Merb, which some people think will become popular in near future. We’re expecting more visitors to come by the offices over the next few days.

Josh Susser and Graeme
Nelson{width=”500” height=”333”}

If you’re in Portland already (Wednesday)… you might head over to the Lucky Lab for a game of Werewolf, which I believe Michael Buffington is organizing the event. I’m going to try to make it… maybe I’ll see you there!

Flickr Group

I created a flickr group named RailsConf 2007, and started to use the tag railsconf2007 for flickr photos. I look forward to seeing all your photos from the event!

IRC Channel

As of this afternoon, there are almost 20 people hanging out in #railsconf on freenode. Stop by and introduce yourself!

Portland Revealed

If you haven’t already subscribed to our feed, you might have missed that the PLANET ARGON team has been posting several articles about things to do, see, and drink in Portland during your visit to RailsConf. Here are a few that we’ve posted so far.

  • [Portland Revealed: Episode 2:
Beertown](http://blog.planetargon.com/2007/5/10/portland-revealed-episode-2-beertown)
```ruby
-   [Portland Revealed: Episode 3: Get
```text
outdoors](http://blog.planetargon.com/2007/5/11/portland-revealed-episode-3-get-outdoors)
```ruby
-   [Portland Revealed: Episode 4: Stay Awake During
```text
RailsConf](http://blog.planetargon.com/2007/5/16/portland-revealed-episode-4-stay-awake-during-railsconf)
```ruby
-   [Portland Revealed: Episode 5: Places to
```text
Work](http://blog.planetargon.com/2007/5/16/portland-revealed-episode-5-places-to-work)
  • More coming soon!

You can also peak around GoSeeOregon (a Rails application!) to find places around town to go see.

RailsConf is coming to Beertown

May 10, 2007

The team at PLANET ARGON is continuing a series of blog posts for all of you who are coming to Portland, Oregon for RailsConf 2007. Allison just posted Portland Revealed: Episode 2: Beertown, which provides a list of places to get good beer in Portland… starting at the PDX Airport to other places around the conference center. We even through in a platial map to make the beer hunt easier for you. :-)

  • [View all Portland Revealed
articles](http://blog.planetargon.com/portland-revealed)

Where is Robby?

May 09, 2007

Just a quick note to those who are waiting to hear back from me about meeting up during/around RailsConf. I’m finally catching up on some of the work that got set back when I recently got sick. If you’re interested in meeting up during/around RailsConf and haven’t already written, you can email me.

There are a few other updates that were mentioned here. one of which is that I’m in the process of drafting a series of articles about the business case for rails, which will correspond with my talk at Ostrava on Rails.

In other news, our team is wrapping up a few big design and development projects and are accepting new project inquiries again for future work. Feel free to contact us to discuss your project with our talented team.

Introducing Boxcar... coming soon to a train station near you!

May 08, 2007

As I just announced on the PLANET ARGON blog. our new hosting solution is almost here!

Last month, we put a freeze on new orders on several of our Rails hosting packages so that we could do some remodeling. Well, we’re almost done and excited about what we’re going to be reopening with. :-)

We’ll be posting updates on the PLANET ARGON blog over the coming days/weeks… so yo might consider subscribing to our feed.

Be sure to sign up on our mailing list to be amongst the first to be notified when Boxcar gets launched!

Speaking at Ostrava on Rails

May 02, 2007

I have been invited to speak at Ostrava on Rails in the Czech Republic this June. I hear that Jamis Buck and Geoffrey Grosenbach will also be speaking at this event. Once a few minor details are set, I’ll post more information about the talk that I am giving, which will related to the Business of Rails panel, which is where you see me speak in just a few weeks at RailsConf 2007 (Portland, OR).

If you’re going to be at the conference in Ostrava, let me know. I’m thinking that I’ll also try to visit Prague before or after the event… as I’ve seen and heard great things about both cities. I believe my lodging in Ostrava will be decided by the powers that be… but if you have any pointers as to where to stay while in Prague, let me know. :-)

Terrific?

April 30, 2007

Don’t get me wrong, I really like it when a site takes some initiative and let’s me know as soon as they can if my username is already taken in their system… but I didn’t think that PublicSquare’s approach to letting me know that my username was available… was the sort of feedback that I was looking for.

There is a slight difference between being an available username and being a terrific choice.

Perhaps they are trying to make me feel good about myself? Shrug… I’ll take the compliment (this time).

Okay, now they’re just trying to kiss my…

Q&A: ActiveRecord Observers and You

April 28, 2007

Yesterday, I wrote a short post titled, Observers Big and Small, about using Observers in your Rails applications.

The following questions were raised in the comments.

When should I use an Observer?

Eric Allam asks…

“Why not just use ActiveRecord callback hooks instead of Observers? Are Observers more powerful or is it just a matter of preference?”

Eric, this is an excellent question. I’d say that a majority of the time, using the ActiveRecord callbacks in your models is going to work for your situation. However, there are times that you want the same methods to be called through callbacks. For example, let’s take a recent problem that we used an observer to solve.

Graeme is working on implementing Ferret into a project that we’re developing for a client. With the use of Ferret, we can index and later search through content over several objects into a format that makes sense for our implementation goals. Each time an object is created and updated, we have to update our Ferret indexes to reflect these changes. The most obvious location that we can call our indexing methods is in each models’ callbacks, but this violates the DRY principle. So, we created an Observer, which observes each of the models that need these methods to be called. In fact, as far as we’re concerned, the fact that we’re indexing some of its data, is none of its business. We only want our models to be concerned with that they’re designed to be concerned about. We may opt to change our indexing solution in the future and we’d just need to rethink that at the Observer level and not change anything about the business logic in our models.

This is the sort of scenario when using an Observer makes great sense in your application.

Logging from an Observer

Adam R. asks…

“I’d also like the ability to use the logger from within an observer, but that’s another issue.”

I assume that you are referring to the logger method? I always forget to even use that method. I do know that the following works just fine in an Observer.

class IndexObserver < ActiveRecord::Observer
  observer Article, Editorial, BlogPost, ClassifiedAd

  def after_save(model)
    RAILS_DEFAULT_LOGGER.warn("Every single day. Every word you say. Every game you play. Every night you stay. I'll be watching you.")
    # execute something fun
  end
end

This will output to your log file without any problem.

This reminded me of when I used to want to log from Unit Tests.

(few minutes later)

Okay, I just attempted to use logger from an Observer and you’re right… it doesn’t currently work. There is a simple fix though, just extend ActiveRecord::Observer to add a logger method like so and require it in config/environment.rb (much like I did in with unit tests).

# lib/observer_extensions.rb
class ActiveRecord::Observer
  def logger
    RAILS_DEFAULT_LOGGER
  end
end

This will give you a solution to that problem.

class FooObserver < ActiveRecord::Observer
  observer Foo

  def after_save(model)
    logger.warn("I wonder if the #{address.class} knows that I've been watching it all along?")
  end
end

Observers Spy for Us

Most often, I look at Observers as being the guys that I hire to spy on my models. I don’t want my models to know that they’re being spied on and I’d like to keep it that way. They don’t solve all of our problems and it’s easy to overuse them. However, I have found several cases that they made a lot of sense and most of those cases have been where we’ve had the same things occurring in our model’s callbacks.

If you have other questions related to Observers, feel free to let me know. If you’re already using Observers, perhaps you could post a comment and/or blog post response with an example of when and how you use Observers in your Rails applications.


Observers Big and Small

April 27, 2007

My colleague, Gary, keeps a stack of Ruby and Rails books on his desk and was implementing an Observer into a client project. It appears that the Agile Web Development with Rails book is still encouraging people to do the following in order to load an Observer.

# app/models/flower_observer.rb
class FlowerObserver < ActiveRecord::Observer
  observe Flower

  def after_create(model)
    # model.do_something!
  end
end

Wouldn't it be cool if it?...oh wait.. it already does

April 23, 2007

Working into the evening on a client project (been sick and trying to play catchup) and was chatting with Allison about working in views and dummy text. I said, “Just make that a shortcut in TextMate.”

Then I thought, “I can’t be the first person to think of that.”

…as I type, lorem [tab]

Figures. Lorem ipsum generator… in TextMate. Why didn’t I know about this before?

So, I ask all of you… what’s your favorite TextMate trick?

Lately… I’ve been enjoying running single spec files with [apple]-r.

You Might Learn Something at the Back of the Train

April 19, 2007

I love to look at other peoples code. Initially, that’s what got me excited about Open Source software. Otherwise, I was looking at small snippets on various developer sites and really not getting the complete picture for how everything tied together.

Last night, I finally had a chance to checkout the sample caboose application, which was created as a way for people to get an idea for how some of developers in caboo.se are putting together their applications.

Some things that you might want to check out it’s using…

Authentication](http://weblog.techno-weenie.net/2006/8/1/restful-authentication-plugin)

It’s definitely worth taking 15 or so minutes to check it out and get some fresh ideas.

There are a few things that I’m not quite sure that didn’t quite make sense, so… perhaps I’ll submit a patch. :-)

svn co svn://caboo.se/plugins/court3nay/empty_apps/tags/v_003

Have fun!