Revision 454:2f1a308c4c11 vendor/plugins/redmine_bibliography

View differences:

vendor/plugins/redmine_bibliography/app/models/publication.rb
12 12

  
13 13
  accepts_nested_attributes_for :authorships
14 14
  accepts_nested_attributes_for :authors, :allow_destroy => true
15
  accepts_nested_attributes_for :bibtex_entry, :allow_destroy => true 
15
  accepts_nested_attributes_for :bibtex_entry, :allow_destroy => true
16
  
17
  has_and_belongs_to_many :projects
16 18
  
17 19
  attr_writer :current_step
18 20

  
vendor/plugins/redmine_bibliography/init.rb
1 1
require 'redmine'
2
require 'dispatcher'
3

  
4

  
5
# Patches to the Redmine core.
6

  
7
Dispatcher.to_prepare :redmine_model_dependencies do
8
  require_dependency 'project'
9

  
10
  unless Project.included_modules.include? Bibliography::ProjectPublicationsPatch
11
    Project.send(:include, Bibliography::ProjectPublicationsPatch)
12
  end
13
end
2 14

  
3 15
Redmine::Plugin.register :redmine_bibliography do
4 16
  name 'Redmine Bibliography plugin'
......
11 23
  permission :view_bibliography, :redmine_bibliography => :index
12 24

  
13 25
  menu :project_menu, :redmine_bibliography, {:controller  => 'publications', :action => 'index'}, :caption  => 'Bibliography', :after => :activity, :param => :project_id
14
  
26

  
27

  
28

  
29

  
30

  
31

  
15 32
end
16 33

  
34

  
vendor/plugins/redmine_bibliography/lib/bibliography/project_publications_patch.rb
1
require_dependency 'project'
2

  
3
module Bibliography
4
  module ProjectPublicationsPatch
5
    def self.included(base)
6
          base.class_eval do
7
            has_and_belongs_to_many :publications
8
          end
9
        end
10
  end #ProjectPublicationsPatch
11
end #RedmineBibliography

Also available in: Unified diff