Proposal: ActionController class methods, all procs get evaluated

34 views
Skip to first unread message

Scott Carleton

unread,
Dec 13, 2012, 12:35:40 PM12/13/12
to rubyonra...@googlegroups.com
Specifically looking at action_cache in Rails.3.2 stable right now.

It currently will evaluate procs given to the layout or cache_path as can be seen here.   

I'm working on a library where I'd like to tag my caches so that I can expire sets of keys easily.  It would appear that something such as 

    caches_action :show, tag: Proc.new { "post_#{params[:id]}" }

would evaluate to the tag to post_1, post_2 etc but it doesn't.  It wouldn't take much to modify the filter method linked above to evaluate all procs passed in as options. I'm going to make a pull request unless there are any objections.

Rafael Mendonça França

unread,
Dec 13, 2012, 4:28:01 PM12/13/12
to rubyonra...@googlegroups.com
Action cache was extracted from Rails and it is not part of the framework anymore.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-core/-/UUqVW18mx50J.
To post to this group, send email to rubyonra...@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-co...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.

Scott Carleton

unread,
Dec 14, 2012, 10:34:58 AM12/14/12
to rubyonra...@googlegroups.com
Ahh.  Thanks for the heads up.

Reply all
Reply to author
Forward
0 new messages