Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 34 lines (25 sloc) 0.734 kB
1a56e06 @chris2fr Factoriser contenu
authored
1 require_dependency 'user'
2
3 # Patches Redmine's Issues dynamically. Adds a relationship
4 # Issue +has_many_and_belongs_to_many+ to User
5 module IssuePatch
6 def self.included(base) # :nodoc:
7 base.extend(ClassMethods)
8
9 base.send(:include, InstanceMethods)
10
11 # Same as typing in the class
12 base.class_eval do
13 unloadable # Send unloadable so it will not be unloaded in development
14 has_and_belongs_to_many :user
15 end
16
17 end
18
19 module ClassMethods
20
21 end
22
23 module InstanceMethods
24 # Wraps the association to get the Deliverable subject. Needed for the
25 # Query and filtering
26 def listusers
27 return self.users
28 end
29 end
30 end
31
32 # Add module to Issue
33 Issue.send(:include, UserPatch)
34
Something went wrong with that request. Please try again.