app/models/programme_item_assignment.rb
#
# TODO - this is a temporary fix until we
# put in a mechanism for the planner to assign the role names etc.
#
this is a temporary fix until we
put in a mechanism for the planner to assign the role names etc.
this is a temporary fix until we put in a mechanism for the planner to assign the role names etc .
def check_role_description
    if role_id == PersonItemRole['Moderator'].id
      role_desc = UserInterfaceSetting.where({:key => 'moderator_role'}).first
      if role_desc
        self.description = role_desc._value
      end
    elsif role_id == PersonItemRole['OtherParticipant'].id
      role_desc = UserInterfaceSetting.where({:key => 'other_role'}).first
      if role_desc
        self.description = role_desc._value
      end
    elsif role_id == PersonItemRole['Participant'].id
      role_desc = UserInterfaceSetting.where({:key => 'participant_role'}).first
      if role_desc
        self.description = role_desc._value
      end
    else
      self.description = nil if self.description != nil
    end
  end
def check_role_description if role_id == PersonItemRole [ 'Moderator' ] . id role_desc = UserInterfaceSetting . where ( { :key => 'moderator_role' } ) . first if role_desc self . description = role_desc . _value end elsif role_id == PersonItemRole [ 'OtherParticipant' ] . id role_desc = UserInterfaceSetting . where ( { :key => 'other_role' } ) . first if role_desc self . description = role_desc . _value end elsif role_id == PersonItemRole [ 'Participant' ] . id role_desc = UserInterfaceSetting . where ( { :key => 'participant_role' } ) . first if role_desc self . description = role_desc . _value end else self . description = nil if self . description != nil end end
TODO - this is a temporary fix until we
put in a mechanism for the planner to assign the role names etc.
TODO - this is a temporary fix until we put in a mechanism for the planner to assign the role names etc .