Permalink
Browse files

Safe constantize mapper

  • Loading branch information...
1 parent 1065fb4 commit 34c66119ccacfe00f81e88c4a79c8b044559c634 @pyromaniac pyromaniac committed Oct 4, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/puffer/extensions/mapper32.rb
@@ -51,7 +51,7 @@ def namespace_with_puffer path, options = {}
end
def resource_scope_with_puffer kind, resource, &block
- controller = "#{[@scope[:module], resource.controller].compact.join("/")}_controller".camelize.constantize rescue nil
+ controller = "#{[@scope[:module], resource.controller].compact.join("/")}_controller".camelize.safe_constantize
if controller && controller.puffer?
singular = kind == :resource
name = (singular ? resource.singular : resource.plural).to_sym

0 comments on commit 34c6611

Please sign in to comment.