SameShirtEveryDay.com

Personal blog of the one called Alex Gorbatchev, from Toronto, Canada.

Growing up

Posted on June 5th, 2007 by Alex Gorbatchev. In Misc. No comments yet...

I didn’t think this moment would come this soon for me. I’ve only been playing with Rails and Ruby for about 3 months.

I did some growing up as a Rails developer last night when I had to change Rails core for Noobkit.

Testing ‘production’ at 3am right before I “quickly” put up the new build brought up a problem with page caching. Noobkit is using URLs which include ‘::’ characters in their paths and silly Rails tries to create fragment cache files with those characters in the path.

That resulted in an obscure and very non descriptive error Errno::EINVAL. This had to be fixed, and so it was:

module NoobkitCaching
  def self.append_features(base)
    base.extend(ClassMethods)
  end

  module ClassMethods
  private
    def page_cache_file(path)
      super.gsub(/::|\^/, '')
    end
  end
end

# and then in environment.rb
ActionController::Base.send :include, NoobkitCaching
You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

No comments yet, be the first one!

Leave a Reply

Allowed tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> , rel="nofollow" in use - no link dropping, no keywords or domains as names; do not spam, and do not advertise!

home
Subscribe to this blog Follow me on Twitter My bookmarks on Delicious My photography on Flickr