diff options
author | Marius Balteanu <marius.balteanu@zitec.com> | 2022-02-28 21:16:08 +0000 |
---|---|---|
committer | Marius Balteanu <marius.balteanu@zitec.com> | 2022-02-28 21:16:08 +0000 |
commit | 4cb518049f1e15919bab916a0f101808ec549ea9 (patch) | |
tree | 413e9076c5239681e5e4ad43547ed2c90420db4e /app/models/role.rb | |
parent | cf016c54171455832e08257631f373aa4fb9e29b (diff) | |
download | redmine-4cb518049f1e15919bab916a0f101808ec549ea9.tar.gz redmine-4cb518049f1e15919bab916a0f101808ec549ea9.zip |
Add habtm relation between roles and queries_roles (#36416).
git-svn-id: http://svn.redmine.org/redmine/trunk@21444 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/role.rb')
-rw-r--r-- | app/models/role.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/app/models/role.rb b/app/models/role.rb index 8a984bbba..790d09f27 100644 --- a/app/models/role.rb +++ b/app/models/role.rb @@ -68,6 +68,8 @@ class Role < ActiveRecord::Base :join_table => "#{table_name_prefix}roles_managed_roles#{table_name_suffix}", :association_foreign_key => "managed_role_id" + has_and_belongs_to_many :queries, :join_table => "#{table_name_prefix}queries_roles#{table_name_suffix}", :foreign_key => "role_id" + has_many :member_roles, :dependent => :destroy has_many :members, :through => :member_roles acts_as_positioned :scope => :builtin |