Skip to content

Commit

Permalink
Safe constantize mapper
Browse files Browse the repository at this point in the history
  • Loading branch information
pyromaniac committed Oct 4, 2012
1 parent 1065fb4 commit 34c6611
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/puffer/extensions/mapper32.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def namespace_with_puffer path, options = {}
end end


def resource_scope_with_puffer kind, resource, &block 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? if controller && controller.puffer?
singular = kind == :resource singular = kind == :resource
name = (singular ? resource.singular : resource.plural).to_sym name = (singular ? resource.singular : resource.plural).to_sym
Expand Down

0 comments on commit 34c6611

Please sign in to comment.