@@ -0,0 +1,6 | |||
|
1 | class Meeting < ActiveRecord::Base | |
|
2 | belongs_to :project | |
|
3 | ||
|
4 | acts_as_activity_provider :timestamp => 'scheduled_on', | |
|
5 | :find_options => { :include => :project } | |
|
6 | end |
@@ -1,13 +1,15 | |||
|
1 | 1 | # Sample plugin migration |
|
2 | 2 | # Use rake db:migrate_plugins to migrate installed plugins |
|
3 |
class Create |
|
|
3 | class CreateMeetings < ActiveRecord::Migration | |
|
4 | 4 | def self.up |
|
5 |
create_table : |
|
|
6 | t.column "example_attribute", :integer | |
|
5 | create_table :meetings do |t| | |
|
6 | t.column :project_id, :integer, :null => false | |
|
7 | t.column :description, :string | |
|
8 | t.column :scheduled_on, :datetime | |
|
7 | 9 | end |
|
8 | 10 | end |
|
9 | 11 | |
|
10 | 12 | def self.down |
|
11 |
drop_table : |
|
|
13 | drop_table :meetings | |
|
12 | 14 | end |
|
13 | 15 | end |
@@ -18,8 +18,13 Redmine::Plugin.register :sample_plugin do | |||
|
18 | 18 | # This permission has to be explicitly given |
|
19 | 19 | # It will be listed on the permissions screen |
|
20 | 20 | permission :example_say_goodbye, {:example => [:say_goodbye]} |
|
21 | # This permission can be given to project members only | |
|
22 | permission :view_meetings, {:meetings => [:index, :show]}, :require => :member | |
|
21 | 23 | end |
|
22 | 24 | |
|
23 | 25 | # A new item is added to the project menu |
|
24 | 26 | menu :project_menu, :sample_plugin, { :controller => 'example', :action => 'say_hello' }, :caption => 'Sample' |
|
27 | ||
|
28 | # Meetings are added to the activity view | |
|
29 | activity_provider :meetings | |
|
25 | 30 | end |
General Comments 0
You need to be logged in to leave comments.
Login now