-1

I'm working on rails 2 application, plugins mostly.

I've two plugins, in my first plugin I've to check if the second plugin is present, how can I do it?

For now, I'm using in report_designer, the first plugin.
Controller : custom_reports

in custom_reports_helper I've

   module CustomReportsHelper
     if File.exist?("#{Rails.root}/vendor/plugins/ReportVariablesHelper") 
       include ReportVariablesHelper
     end
   end

ReportVariablesHelper is from second plugin named variables_for_data

is this a good solution or any better ways in RoR?

Nithin
  • 3,679
  • 3
  • 30
  • 55

1 Answers1

0

You can do:

module CustomReportsHelper
  include ReportVariablesHelper if defined?(ReportVariablesHelper)
end
Marek Lipka
  • 50,622
  • 7
  • 87
  • 91