explicitly define fix has_and_belongs_to_many join_table at Group and User

Rails4 cannot resolve automatically.

git-svn-id: http://svn.redmine.org/redmine/trunk@12471 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2013-12-27 23:33:15 +00:00
parent 24904b4a03
commit e9470e5585
2 changed files with 8 additions and 4 deletions

View File

@ -18,8 +18,10 @@
class Group < Principal
include Redmine::SafeAttributes
has_and_belongs_to_many :users, :after_add => :user_added,
:after_remove => :user_removed
has_and_belongs_to_many :users,
:join_table => "#{table_name_prefix}groups_users#{table_name_suffix}",
:after_add => :user_added,
:after_remove => :user_removed
acts_as_customizable

View File

@ -68,8 +68,10 @@ class User < Principal
['none', :label_user_mail_option_none]
]
has_and_belongs_to_many :groups, :after_add => Proc.new {|user, group| group.user_added(user)},
:after_remove => Proc.new {|user, group| group.user_removed(user)}
has_and_belongs_to_many :groups,
:join_table => "#{table_name_prefix}groups_users#{table_name_suffix}",
:after_add => Proc.new {|user, group| group.user_added(user)},
:after_remove => Proc.new {|user, group| group.user_removed(user)}
has_many :changesets, :dependent => :nullify
has_one :preference, :dependent => :destroy, :class_name => 'UserPreference'
has_one :rss_token, :class_name => 'Token', :conditions => "action='feeds'"