Book Image

Redmine Plugin Extension and Development

By : Alex Bevilacqua
Book Image

Redmine Plugin Extension and Development

By: Alex Bevilacqua

Overview of this book

Table of Contents (16 chapters)
Redmine Plugin Extension and Development
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Configuring an activity provider


For a model to be designated as an activity provider, we'll need to implement the acts_as_activity_provider plugin that comes with Redmine.

The method's signature for this plugin is as follows:

def acts_as_activity_provider(options = {})

If we're looking to dive directly into the source code for the plugin, it is available as part of our Redmine installation at /path/to/redmine/lib/plugins/acts_as_activity_provider/lib/acts_as_activity_provider.rb.

The acts_as_activity_provider plugin is another class extension plugin and requires us to call the acts_as_activity_provider method within our model's class definition along with some parameters as follows:

class KbArticle < ActiveRecord::Base
  # ...

  acts_as_activity_provider :find_options => {:include => :project},
                            :author_key   => :author_id, 
                            :type         => 'kb_articles',
                            :timestamp    => :updated_at
  # ....