Skip to content

Instantly share code, notes, and snippets.

View jcreed's full-sized avatar

Jeff Reed jcreed

  • Liaison International
  • Amherst NY
  • X @jcreed63
View GitHub Profile
@jcreed
jcreed / Deleter Loader error on gpa_by_academic_years
Created October 9, 2015 15:25
Deleter Loader error on gpa_by_academic_years
==> loader/log/development.log <==
I, [2015-10-09T08:51:18.644949 #2520] INFO -- : Establishing connection to redis, queues = ["cas3_etl_loader_dev", "self_pipe_2520"]
==> loader/log/development.sql.log <==
E, [2015-10-09T08:51:18.648075 #2520] ERROR -- : PG::Error: ERROR: operator does not exist: integer = record
LINE 1: ... id FROM gpa_by_academic_years WHERE applicant_id = ('id-pro...
^
HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.: SELECT id FROM gpa_by_academic_years WHERE applicant_id = ('id-proxy', 'b8668aa0-bccc-419b-a39e-6f8eb85cab32')
I, [2015-10-09T08:51:18.648396 #2520] INFO -- : (0.000069s) ROLLBACK
namespace :airbrake_logs do
desc "Load all errors from Airbrake logs"
task :re_etl => [:environment] do |task|
display :notice, task.full_comment
errors = ["PG::Error: ERROR: deadlock detected", 'PG::Error: ERROR: null value in column "program_id"']
errors.each do |group_error|
group = Cas3Logs::Api::Groups.new(group_error)
if group_key = group.group_key
pages = group.notice_pages
namespace :airbrake_logs do
desc "Retreive all errors from Airbrake logs"
task :re_etl => [:environment] do |task|
display :notice, task.full_comment << " for WebAdMIT"
errors = ["PG::Error: ERROR: deadlock detected", 'PG::Error: ERROR: null value in column "program_id"']
errors.each do |group_error|
group = Cas3Logs::Api::Groups.new(group_error)
if group_key = group.group_key
pages = group.notice_pages
@jcreed
jcreed / WA-3876 - working locally
Created November 17, 2015 21:42
WA-3876 - a successful search
Started GET "/search?utf8=%E2%9C%93&last_name=z&first_name=a&cas_id=&professional_pin=&state=&email=&application_status=350&local_status=&decision_code=&designation_submitted_date=&designation=&application_last_changed_on=&reviewer=&_submit=1" for 127.0.0.1 at 2015-11-17 16:32:58 -0500
Processing by Search::SearchesController#show as HTML
Parameters: {"utf8"=>"✓", "last_name"=>"z", "first_name"=>"a", "cas_id"=>"", "professional_pin"=>"", "state"=>"", "email"=>"", "application_status"=>"350", "local_status"=>"", "decision_code"=>"", "designation_submitted_date"=>"", "designation"=>"", "application_last_changed_on"=>"", "reviewer"=>"", "_submit"=>"1"}
(0.1ms) SHOW search_path
User Load (5.5ms) SELECT "users".* FROM "users" WHERE "users"."id" = 106 LIMIT 1 /*application:Webadmit,controller:searches,action:show*/
(0.1ms) BEGIN /*application:Webadmit,controller:searches,action:show*/
(0.4ms) UPDATE "users" SET "last_request_at" = '2015-11-17 21:32:59.447698', "perishable_token" = '4ikt8BwAdieeaf
@jcreed
jcreed / EXPLAIN ANALYZE
Created November 19, 2015 15:20
WA-3876 Search Query analyzed
Limit (cost=10966.16..10966.26 rows=1 width=3246) (actual time=95728.042..95728.058 rows=25 loops=1)
-> Unique (cost=10966.16..10966.26 rows=1 width=3246) (actual time=95728.041..95728.055 rows=25 loops=1)
-> Sort (cost=10966.16..10966.17 rows=1 width=3246) (actual time=95728.040..95728.041 rows=25 loops=1)
Sort Key: (lower((applicants.last_name)::text)), (lower((applicants.first_name)::text)), applicants.id, applicants.ssn, applicants.created_at, applicants.updated_at, applicants.score, applicants.identifier, applicants.email, applicants.last_name, applicants.middle_name, applicants.first_name, applicants.suffix, applicants.title, applicants.last_refresh, applicants.date_added, applicants.cas_id, applicants.association_id, applicants.application_complete, applicants.verified, applicants.verified_date, applicants.professional_pin, applicants.match_id, applicants.pre_submission_release_authorized, applicants.photo_file_name, applicants.photo_content_type, applicants.photo_file_
diff --git a/app/models/honors_and_awards.rb b/app/models/honors_and_awards.rb
index 64c2d03..9b8f88c 100644
--- a/app/models/honors_and_awards.rb
+++ b/app/models/honors_and_awards.rb
@@ -2,6 +2,6 @@ class HonorsAndAwards < ApplicationModel
belongs_to :applicant
belongs_to :achievement_type, class_name: 'Lookups::AchievementType'
- belongs_to :publication_level, class_name: 'Lookups::PublicationLevel'
+ belongs_to :publication_level, class_name: 'Lookups::PublicationLevel', foreign_key: :level
@jcreed
jcreed / gist:c8b0fd2ba7606219c9e9
Created February 23, 2016 19:33
config/deletion_info.yml
- table_name: :cas_attachments
api_route_name: 'cas_attachments'
type:
scope_owner_type:
:cas: 'Certification'
- table_name: :cas_attachments
api_route_name: 'cas_attachments'
type:
scope_owner_type:
:cas: 'Diploma'
@jcreed
jcreed / background check test
Created March 30, 2016 16:54
background check test
require 'test_helper'
feature 'Background Checks' do
let(:background_check_account) { create :background_check_account }
let(:background_check_request) { create :background_check_request, applicant: designation.applicant, background_check_account: background_check_account }
let(:designation) { create :designation_with_applicant, program: program }
let(:program) { background_check_account.program }
let(:user_identity) { create :organization_user_identity_for_integration_tests, cas: program.cas, programs: [program] }
let(:feature_assignment) { create :feature_assignment, feature: background_check_feature, assignee: program.cas }
@jcreed
jcreed / gist:a0c853b5b675715d239661c6bd2e9237
Created April 21, 2016 13:51
Transformer xml issues from morning of 4/21/16
This file has been truncated, but you can view the full file.
W, [2016-04-21T03:21:13.025245 #15367] WARN -- : Invalid XML for applicant: 4679292222
W, [2016-04-21T03:21:13.025767 #15367] WARN -- : Element 'Biographicinfo': Missing child element(s). Expected is one of ( AlternateNames, PreferredName, GeneralDemographics, SocioEconomicInformation, Childhood, SelfReportedDisadvantagedStatus, AlternateIds ).
W, [2016-04-21T03:21:13.025898 #15367] WARN -- : Element 'CollegeAttended', attribute 'code': The attribute 'code' is not allowed.
W, [2016-04-21T03:21:13.025983 #15367] WARN -- : Element 'AccreditingAgency': This element is not expected.
W, [2016-04-21T03:21:13.026061 #15367] WARN -- : Element 'CollegeAttended', attribute 'code': The attribute 'code' is not allowed.
W, [2016-04-21T03:21:13.026136 #15367] WARN -- : Element 'AccreditingAgency': This element is not expected.
W, [2016-04-21T03:21:13.026209 #15367] WARN -- : Element 'CollegeAttended', attribute 'code': The attribute 'code' is not allowed.
W, [2016-04-21T03:21:13.026319 #15367] WARN -- :
namespace :releases do
namespace "5.56" do
namespace :after_load do
desc "Delete invalid CAS Custom Questions"
task "UNCAS-8212" => [:environment] do |task|
display :notice, task.full_comment
require 'csv'
csv_file = IO::read(File.join(Rails.root, "db/data/2016/invalid_custom_question_ids.csv"), :encoding => 'UTF-8')
csv = CSV.new csv_file, headers: true