Revision 14030
Added by Jean-Philippe Lang over 10 years ago
trunk/extra/sample_plugin/app/models/meeting.rb | ||
---|---|---|
7 | 7 |
:url => Proc.new {|o| {:controller => 'meetings', :action => 'show', :id => o.id}} |
8 | 8 |
|
9 | 9 |
acts_as_activity_provider :timestamp => 'scheduled_on', |
10 |
:find_options => { :include => :project }
|
|
10 |
:scope => includes(:project)
|
|
11 | 11 |
end |
trunk/lib/plugins/acts_as_activity_provider/lib/acts_as_activity_provider.rb | ||
---|---|---|
29 | 29 |
send :include, Redmine::Acts::ActivityProvider::InstanceMethods |
30 | 30 |
end |
31 | 31 |
|
32 |
options.assert_valid_keys(:type, :permission, :timestamp, :author_key, :find_options, :scope)
|
|
32 |
options.assert_valid_keys(:type, :permission, :timestamp, :author_key, :scope) |
|
33 | 33 |
self.activity_provider_options ||= {} |
34 | 34 |
|
35 | 35 |
# One model can provide different event types |
... | ... | |
37 | 37 |
event_type = options.delete(:type) || self.name.underscore.pluralize |
38 | 38 |
|
39 | 39 |
options[:timestamp] ||= "#{table_name}.created_on" |
40 |
options[:find_options] ||= {} |
|
41 | 40 |
options[:author_key] = "#{table_name}.#{options[:author_key]}" if options[:author_key].is_a?(Symbol) |
42 | 41 |
self.activity_provider_options[event_type] = options |
43 | 42 |
end |
Also available in: Unified diff
Removed no longer used :find_options option for acts_as_activity_provider.