Skip to content
Browse files

Caching is now handled by the Resolver superclass

  • Loading branch information...
1 parent a091196 commit 9307391970d4203a0a1e53e7512421fc82000587 @wycats committed
Showing with 13 additions and 15 deletions.
  1. +13 −15 lib/awesome_theme/lib/awesome_theme.rb
View
28 lib/awesome_theme/lib/awesome_theme.rb
@@ -4,24 +4,22 @@
module Themes
class Resolver < ActionView::Resolver
def find_templates(name, details, prefix, partial)
- cached([name, details, prefix, partial]) do
- scope = Template.scoped(:conditions => { :name => name, :prefix => prefix })
+ scope = Template.scoped(:conditions => { :name => name, :prefix => prefix })
- if formats = details[:formats]
- formats = formats.map { |f| f.to_s }
- scope = scope.scoped(:conditions => { :format => formats })
- end
+ if formats = details[:formats]
+ formats = formats.map { |f| f.to_s }
+ scope = scope.scoped(:conditions => { :format => formats })
+ end
- if locales = details[:locales]
- locales = locales.map { |f| f.to_s }
- scope = scope.scoped(:conditions => { :locale => locales })
- end
+ if locales = details[:locales]
+ locales = locales.map { |f| f.to_s }
+ scope = scope.scoped(:conditions => { :locale => locales })
+ end
- scope.all.map do |r|
- handler = ActionView::Template.handler_class_for_extension(r.handler)
- details = { :locale => r.locale, :format => r.format, :partial => r.partial }
- ActionView::Template.new(r.source, "record", handler, details)
- end
+ scope.all.map do |r|
+ handler = ActionView::Template.handler_class_for_extension(r.handler)
+ details = { :locale => r.locale, :format => r.format, :partial => r.partial }
+ ActionView::Template.new(r.source, "record", handler, details)
end
end
end

0 comments on commit 9307391

Please sign in to comment.
Something went wrong with that request. Please try again.