From 060e06daa065f02b811dfe12850b101a62c12c8d Mon Sep 17 00:00:00 2001 From: jessib Date: Tue, 27 Aug 2013 12:38:16 -0700 Subject: Not ideal way to do it, but was proving complicated to have a config file specify which gems for which environments. Here, we have the billing gem included for the development and test environments only, hardcoded in the Gemfile. Then we show the links to billing based on a config file setting. The setting itself could be used to specify different types of billing, but isn't yet. --- app/helpers/application_helper.rb | 5 ----- app/views/layouts/_navigation.html.haml | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) (limited to 'app') diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index cdc34ea..1e79990 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -37,9 +37,4 @@ 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 diff --git a/app/views/layouts/_navigation.html.haml b/app/views/layouts/_navigation.html.haml index fb018a9..053c62c 100644 --- a/app/views/layouts/_navigation.html.haml +++ b/app/views/layouts/_navigation.html.haml @@ -2,5 +2,5 @@ = link_to_navigation t(:overview), user_overview_path(@user), :active => controller?(:overviews) = link_to_navigation t(:account_settings), edit_user_path(@user), :active => controller?(:users) = link_to_navigation t(:support_tickets), auto_tickets_path, :active => controller?(:tickets) - = link_to_navigation t(:billing_settings), show_or_new_customer_link(@user), :active => controller?(:customer, :payments, :subscriptions, :credit_card_info) if engine_enabled('LeapWebBilling') + = link_to_navigation t(:billing_settings), show_or_new_customer_link(@user), :active => controller?(:customer, :payments, :subscriptions, :credit_card_info) if APP_CONFIG[:payment].present? = link_to_navigation t(:logout), logout_path, :method => :delete -- cgit v1.2.3