学生身份的编辑
This commit is contained in:
parent
816a480991
commit
0047f7bfdf
|
@ -52,6 +52,9 @@ class Member < ActiveRecord::Base
|
|||
ids += member_roles.select {|mr| !mr.inherited_from.nil?}.collect(&:role_id)
|
||||
|
||||
new_role_ids = ids - role_ids
|
||||
if (new_role_ids.include?(7) || new_role_ids.include?(9)) && role_ids.include?(10)
|
||||
member_roles.where("role_id = 10").first.update_column('is_current', 0)
|
||||
end
|
||||
# Add new roles
|
||||
if new_role_ids.include?(7) && new_role_ids.include?(10)
|
||||
member_roles << MemberRole.new(:role_id => 7)
|
||||
|
|
Loading…
Reference in New Issue