Module: Redmine::Acts::Event::ClassMethods

Defined in:
lib/plugins/acts_as_event/lib/acts_as_event.rb

Instance Method Summary collapse

Instance Method Details

#acts_as_event(options = {}) ⇒ Object



28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/plugins/acts_as_event/lib/acts_as_event.rb', line 28

def acts_as_event(options = {})
  return if self.included_modules.include?(Redmine::Acts::Event::InstanceMethods)
  default_options = { :datetime => :created_on,
                      :title => :title,
                      :description => :description,
                      :author => :author,
                      :url => {:controller => 'welcome'},
                      :type => self.name.underscore.dasherize }

  cattr_accessor :event_options
  self.event_options = default_options.merge(options)
  send :include, Redmine::Acts::Event::InstanceMethods
end