Test if a Plugin is Installed
It may be necessary to enable certain plugin functionality based on the presence of other plugins. The
Workarea::Plugin.installed? method may be used to test if a plugin is installed.
Workarea::Plugin.installed?('Workarea::WishLists') Workarea::Plugin.installed?('wish_lists') Workarea::Plugin.installed?(:wish_lists)
For example, in the API plugin, you want to add functionality if the Wish Lists plugin is present.
if Workarea::Plugin.installed?(:wish_lists) module Workarea module Api module Users class WishListsController < Api::ApplicationController def show @user = User.find(params[:user_id]) @wish_list = WishList.for_user(@user.id) end end end end end end
How'd We Do?
Was this article missing something?
Was it not quite what you were looking for?
Do you have suggestions on how we could improve this article or your experience in general?
If so, please take a moment to let us know!
Your invaluable feedback will help everyone better understand the platform!