Forum: Ruby on Rails How to know that a plugin is loaded

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
89e7c8b162c71e9905fbfe7d2ec376dc?d=identicon&s=25 Fernando Blat (Guest)
on 2006-05-31 15:25
(Received via mailing list)
Hi!

We are developing an application in which the plugin acts_as_taggable
can be loaded or not. So we need to know if the plugin is loaded in
order to call the acts_as_taggable function en the model definition.

We have found a not so elegant solution:

class Post < ActiveRecord::Base

  acts_as_taggable  if defined? Tag
  ....
end

That is, check if the class Tag (a class that creates the plugin) is
defined?

Do you know a more elegant alternative?

By the way, this works perfectlly with Lighttpd + FastCGIs, but in our
development envirnonment, using Apache2 + FastCGIs it only works in
the first requirement to the dispatch. Any idea?

Thanks!
This topic is locked and can not be replied to.