I am writing a plugin in redmine 1.4, and as a part of my project, I need to establish a one to many relation between a model created by me (ex: lms_users), and a model that is part of the Redmine core ('users'). I know that the usual way to create this relation is by using "belongs_to : user" inside the "LmsUser" model ,and a "has_many :users", inside the User, but this would involve modifying the core model "users", and it's out of discussion.
Is there any way to solve this problem, so there should not be anay dependency issues in core?
There is no other way than (monkey) patching the User
class if you want to
access your plugin model from the user.
On the other hand, this is not necessary if you access to User
class from your
model.
In all cases, patching the Redmine core is the usual way to extend Redmine. It is no big deal ! It is a very common practice... Just look at some plugins (those from Eric Davis for instance). Don't be afraid to do that but the only warning i give to you is : be sure to understand what you are doing.