Forums » Development »
Added by anhkhoa Michel about 10 years ago
Hi all. I want to get group_id of current user And I used: User.current.group.id but This error. Please help me!!!!
Hi Ankhoa,
A user can actually have several groups.
That's why in order to collect the array of Ids you should use:
User.current.group_ids
Cheers,
Example use:
isSuporte = false
User.current.group_ids.each do |item|
if item == 8
isSuporte = true
end
end