From d0a15a50e1fdf08f2283562453d4e803aa7b31c8 Mon Sep 17 00:00:00 2001 From: jessib Date: Tue, 13 Aug 2013 10:37:31 -0700 Subject: Option to disable billing engine and hide billing related links. To actual disable, must remove billing engine from Gemfile (and re-bundle) --- app/helpers/application_helper.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'app/helpers/application_helper.rb') diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 1e79990..cdc34ea 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -37,4 +37,9 @@ module ApplicationHelper html_escape(msg).gsub('[b]', '').gsub('[/b]', '').html_safe end + def engine_enabled(name) + # to disable engine, comment it out in Gemfile (and make sure to re-run bundle install) + Rails::Application::Railties.engines.any? {|eng| eng.class.to_s == "#{name}::Engine"} + end + end -- cgit v1.2.3