Site Archives:
On updating vs. editing.
Posted by
Tom | August 25, 2007 comments One Response

We recently had some great posts on the forum from larryk. I was just replying to Larry, and, what with the cup of rather fine Darjeeling, and an indulgently large pile of mini gingerbread-man biscuits, I got into the swing of it until I thought - this is a blog post!

Quick background — Larry has a model with 60(!) fields, and he has a page with <editor> tags for all of them. He’s discovered an O(n^2) problem because each call to <edit> calls updatable_by? which has to check all 60 fields to see what has changed.

Not pretty.

continue reading
Quiz
Posted by
Tom | August 25, 2007 comments 14 Responses

This neat hack just popped into my head — something I’ve wanted for ages. But what is it for?

    class Object
      def _?()
        self
      end
    end

    class NilClass
      def _?()
        SafeNil.new
      end
    end

    class SafeNil
      def method_missing(*args, &b)
        nil.send(*args, &b) rescue nil
      end
    end

Hobo 0.6.1 released
Posted by
Tom | August 25, 2007 comments 6 Responses

Not too bad — only one day later than advertised :-) It’s time to

gem update hobo

or

svn up vendor/plugins/hobo

Not content to fix a few of the problems in 0.6, we’ve added some major new features in 0.6.1

There’s a major overhaul to the Ajax part update mechanism. It’s now more secure and can cope with parts that need access to local variables.

Hobo now supports multiple user models, so you could for example have a separate model for regular users and administrators. Each has its own login and signup pages.

As always, see the changelog for the nitty gritty.

Methodphitamine - I’m hooked without even using it
Posted by
Tom | August 24, 2007 comments One Response

Now that is going straight into Hobo’s core extensions. Thanks for sharing Jay!

Meaning I can finally get rid of all that omap, oselect nonsense (if you didn’t notice those methods, don’t even ask, it was a bad idea. If you did and you use them - stop!)

Hmmm. Maybe it’s time to make this stuff available in a separate gem. HoboSupport? It’s starting to bug me when I’m in a non-Hobo script and all this stuff is missing.

p.s. Hobo 0.6.1 coming today!