Module: Rubix::Associations::BelongsToUserGroup

Included in:
Operation
Defined in:
lib/rubix/associations/belongs_to_user_group.rb

Instance Method Summary collapse

Instance Method Details

#user_groupObject



11
12
13
14
15
# File 'lib/rubix/associations/belongs_to_user_group.rb', line 11

def user_group
  return @user_group if @user_group
  return unless @user_group_id
  @user_group = UserGroup.find(:id => @user_group_id)
end

#user_group=(ug) ⇒ Object



5
6
7
8
9
# File 'lib/rubix/associations/belongs_to_user_group.rb', line 5

def user_group= ug
  return unless ug
  @user_group    = ug
  @user_group_id = ug.id
end

#user_group_idObject



22
23
24
25
26
# File 'lib/rubix/associations/belongs_to_user_group.rb', line 22

def user_group_id
  return @user_group_id if @user_group_id
  return unless @user_group
  @user_group_id = @user_group.id
end

#user_group_id=(ugid) ⇒ Object



17
18
19
20
# File 'lib/rubix/associations/belongs_to_user_group.rb', line 17

def user_group_id= ugid
  return unless ugid
  @user_group_id = ugid
end