I got my Redmine (v2.0.3) working. It now shows in the project menu of every project but I can't figure out how to only activate it for selected projects. E.g. only for projects that have a project custom field set to a specific value. I got the custom field created and figured out where the data is stored. But how do I tell Redmine when to or not to show the plugin in the project menu?
I did come across the possibility to use :if to specify a proc but the proc doesn't allow me to call a method of one of my plugins created models. E.g. I created a model called Param and I want to call the method Param.check_to_display. But shows the error message
ActionView::Template::Error (undefined method 'check_to_display' for Param(....):Class)
My init.rb says:
menu :project_menu, :info, {:controller=>'info', :action=>'index'}, :caption=>'Ticker', :after=>:activity, :param=>:project_id, :if=>Proc.new{||Param.check_to_display()}