app/controllers/programme_items_controller.rb
#
# Return a program item given an id
#  
Return a program item given an id
Return a program item given an id
def show
    @extra_item_json = [] if ! @extra_item_json
    @programmeItem = ProgrammeItem.find(params[:id])
    @invisibleAssociations = ProgrammeItemAssignment.rank(:sort_order).
                                    where(['programme_item_id = ? AND role_id =?',@programmeItem.id,PersonItemRole['Invisible'].id]).
                                    includes({:person => :pseudonym}).
                                    order("people.last_name")
      @moderatorAssociations = ProgrammeItemAssignment.rank(:sort_order).
                        where(['programme_item_id = ? AND role_id = ?', @programmeItem.id, PersonItemRole['Moderator'].id]).
                        includes({:person => :pseudonym}).
                        order("people.last_name")
      @participantAssociations = ProgrammeItemAssignment.rank(:sort_order).
                                  where(['programme_item_id = ? AND role_id = ?', @programmeItem.id, PersonItemRole['Participant'].id]).
                                  includes({:person => :pseudonym}).
                                  order("people.last_name")
      @otherParticipantAssociations = ProgrammeItemAssignment.rank(:sort_order).
                                  where(['programme_item_id = ? AND role_id = ?', @programmeItem.id, PersonItemRole['OtherParticipant'].id]).
                                  includes({:person => :pseudonym}).
                                  order("people.last_name")
      @reserveAssociations = ProgrammeItemAssignment.rank(:sort_order).
                                  where(['programme_item_id = ? AND role_id = ?', @programmeItem.id, PersonItemRole['Reserved'].id]).
                                  includes({:person => :pseudonym}).
                                  order("people.last_name")
  rescue => ex
    Rails.logger.error ex.message if Rails.env.development?
    Rails.logger.error ex.backtrace.join("\n\t") if Rails.env.development?
    render status: :bad_request, text: ex.message
  end
def show @extra_item_json = [ ] if ! @extra_item_json @programmeItem = ProgrammeItem . find ( params [ :id ] ) @invisibleAssociations = ProgrammeItemAssignment . rank ( :sort_order ) . where ( [ 'programme_item_id = ? AND role_id =?' , @programmeItem . id , PersonItemRole [ 'Invisible' ] . id ] ) . includes ( { :person => :pseudonym } ) . order ( "people.last_name" ) @moderatorAssociations = ProgrammeItemAssignment . rank ( :sort_order ) . where ( [ 'programme_item_id = ? AND role_id = ?' , @programmeItem . id , PersonItemRole [ 'Moderator' ] . id ] ) . includes ( { :person => :pseudonym } ) . order ( "people.last_name" ) @participantAssociations = ProgrammeItemAssignment . rank ( :sort_order ) . where ( [ 'programme_item_id = ? AND role_id = ?' , @programmeItem . id , PersonItemRole [ 'Participant' ] . id ] ) . includes ( { :person => :pseudonym } ) . order ( "people.last_name" ) @otherParticipantAssociations = ProgrammeItemAssignment . rank ( :sort_order ) . where ( [ 'programme_item_id = ? AND role_id = ?' , @programmeItem . id , PersonItemRole [ 'OtherParticipant' ] . id ] ) . includes ( { :person => :pseudonym } ) . order ( "people.last_name" ) @reserveAssociations = ProgrammeItemAssignment . rank ( :sort_order ) . where ( [ 'programme_item_id = ? AND role_id = ?' , @programmeItem . id , PersonItemRole [ 'Reserved' ] . id ] ) . includes ( { :person => :pseudonym } ) . order ( "people.last_name" ) rescue => ex Rails . logger . error ex . message if Rails . env . development? Rails . logger . error ex . backtrace . join ( "\n\t" ) if Rails . env . development? render status : :bad_request , text : ex . message end
Return a program item given an id
Return a program item given an id
# Order these by last name