Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

[PATCH] Add support for setting cache_id and convience option :find_by

#87

Allows cache_fu to use something other than .id for the "id" of a cached model. This is accessible through your own cache_id method or doing "acts_as_cached :id => :user_id". Make sure that the id you're

about to use is unique, and you'll probably want to set the finder to something like :find_by_user_id.

Because you'll almost always want to set these two options together, :find_by => :user_id will automatically turn into :finder => :find_by_user_id, :cache_id => :user_id

Reported by Elijah Miller · August 17th, 2007 @ 07:07 PM

State: resolved
Milestone: none
Assigned to: Chris Wanstrath Chris Wanstrath

Activity

  1. Chris Wanstrath
    Chris Wanstrath
    • State changed from new to resolved

    (from [325]) - Add support for setting cache_id and convience option :find_by [Elijah Miller] [#87 state:resolved]

    http://plugins.require.errtheblo...

    August 17th, 2007 @ 07:19 PM

  2. Chris Wanstrath
    Chris Wanstrath

    Awesome, applied.

    Just a test/spec note. Instead of:

    Story.cache_options.include?(:pengiuns).should.equal true
    

    you can just do

    Story.cache_options.should.include :pengiuns
    

    Same with negatives (should.not.include).

    Thanks.

    August 17th, 2007 @ 07:19 PM

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.