Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move conditionals for clarity #475

Merged
merged 1 commit into from Aug 30, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions app/helpers/camaleon_cms/hooks_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,18 @@ def _do_hook(plugin, hook_key, params = nil)
plugin["hooks"][hook_key].each do |hook|
next if @_hooks_skip.present? && @_hooks_skip.include?(hook)
begin
send(hook, params) unless params.nil?
send(hook) if params.nil?
if params.nil?
send(hook)
else
send(hook, params)
end
rescue
plugin_load_helpers(plugin)
send(hook, params) unless params.nil?
send(hook) if params.nil?
if params.nil?
send(hook)
else
send(hook, params)
end
end
end
end
Expand Down