Decouple the File in your Rails Plugin, Please

Defining new behavior for core Rails classes in mixins is a common pattern in Rails plugins. This allows for a separation of concerns that improves maintainability and digestability. However, it raises a bit of question about where the mixin inclusion step should take place. Should it happen in the plugin’s init.rb or in the same file as the mixin module is defined?

I recently had cause to use a couple of Rails plugins outside of a rails project. This experience has allowed me to resolve this question, and the answer is: include the new behavior in the core classes in the same file that you define the behavior. That way if you need to use a subset of the behaviors defined in a plugin you can just require that file. The people who use your plugin in ways you don’t yet anticipate will thank you.

Oh yeah, and please don’t rely on the automatic module creation that dependency base autoloading in ActiveSupport provides. It is a lot simpler for your users if you explicitly define all the modules you need.

Hyper-speech

“you mention wabi-sabi, I do nothing
a blog I read mentions it, I follow the wiki link
maybe you could use links when talking”

my wife

“Today was such a good day”

So said Elliot on the way home yesterday evening. And he was right.

We spent the morning at Boulder Reservoir for a company picnic. The food and the band were great. And the kids had a blast playing in the water, jumping in the bouncy castle and riding the boats.1

One the way home we noticed that there was a lot of air traffic around the Boulder Airport. So on a whim, we drove over to see what was up. It turned out that the second annual Airport Day was going on. Both Audrey and Elliot love airplanes so it was a big hit. There were many aircraft to look at and planes and helicopters where landing and taking off very frequently. The kids were in heaven.

And then Catherine spotted the glider rides booth. They were running a special for Airport Day. So Elliot an I took a short glider ride. It is a beautiful thing. The mountains and Boulder are gorgeous from a couple of thousand feet. Elliot is pretty sure that gliders are the best thing since sliced bread, now. All in all, a spectacular way to miss nap time.

Elliot in front of glider

After all that excitement we did manage to get the kids to nap for an hour or so before we dropped them off at a friend’s house so that Catherine and I celebrated our sixth wedding anniversary. We had a really nice, relaxing diner at Iron Mountain Winery. Followed by some coffee and perusing in a book store.

Yep, I think “Today was such a good day.” pretty much sums it up.


  1. This was my first experience with peddle boats, actually. They are a bit more work operate than I expected.

    </li> </ol> </div>

Modest Mouse at Red Rocks

On Wednesday Catherine, Joshua (get a blog) and I saw Modest Mouse at Red Rocks. They put on a really excellent show and Red Rocks has got to be one of the coolest venues in the country. As Scott Davis said “No one should die before seeing their favorite band play Red Rocks”.1 My ears are still ringing but that is a small price to pay for seeing such an amazing show.

Modest Mouse at Red Rock tickets

My only real complaint is that the sound engineering was pretty crap. It took about three songs to get the levels right for the vocalists. For each of the three acts. I have a little bit of advice, as complete amateur, for the sound engineers at Red Rock: How about you set levels for the instruments with direct inputs to only be a few dB over the pain threshold. That way you will have some headroom when the singing starts. It will still hurt peoples ears so you would still be cool with your sound engineering buddies and we would be able to hear the, undistorted, vocals.


  1. He is also right about the Denver Botanic Gardens. Their grassy bowl encourages an intimacy unlike any other venue I have ever been to. You should go see something there too.

    </li> </ol> </div>