cirandas.net

ref: master

plugins/stoa/lib/stoa_plugin/usp_aluno_turma_grad.rb


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
require_relative '../../test/setup_db' if Rails.env.test?

class StoaPlugin::UspAlunoTurmaGrad < ApplicationRecord

  establish_connection :stoa

  self.table_name = :alunoturma_gr

  def self.exists?(usp_id)
    StoaPlugin::UspUser.find_by codpes: usp_id.to_i
  end

  def self.classrooms_from_person(usp_id)
    StoaPlugin::UspAlunoTurmaGrad.where codpes: usp_id
  end

end