From e936f11c9f52e0eeab076a2d0f2c9a4618c7dd95 Mon Sep 17 00:00:00 2001 From: IJ Kim Date: Tue, 11 Apr 2017 09:41:42 -0400 Subject: [PATCH] refactored not_check_in methods --- lib/sf/reg_registration.rb | 17 +++-------------- lib/sf/version.rb | 2 +- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/lib/sf/reg_registration.rb b/lib/sf/reg_registration.rb index e373e91..7312f9f 100644 --- a/lib/sf/reg_registration.rb +++ b/lib/sf/reg_registration.rb @@ -152,20 +152,9 @@ def self.not_checked_in(code) self.query_with_reg_item_codes(where_stmt, order_stmt) end - def self.not_checked_in_a_to_i(code) - where_stmt = "event_code__c = \'#{code}\' and status__c = \'processed\' and check_in_at__c = null and last_name__c < \'J\'" - order_stmt = self.order_by(last_name__c: "ASC") - self.query_with_reg_item_codes(where_stmt, order_stmt) - end - - def self.not_checked_in_j_to_r(code) - where_stmt = "event_code__c = \'#{code}\' and status__c = \'processed\' and check_in_at__c = null and last_name__c > \'J\' and last_name__c < \'S\'" - order_stmt = self.order_by(last_name__c: "ASC") - self.query_with_reg_item_codes(where_stmt, order_stmt) - end - - def self.not_checked_in_s_to_z(code) - where_stmt = "event_code__c = \'#{code}\' and status__c = \'processed\' and check_in_at__c = null and last_name__c > \'S\'" + def self.not_checked_in_last_name_between(code, a, z) + next_letter = z.downcase + "zzzzzzzzzz" + where_stmt = "event_code__c = \'#{code}\' and status__c = \'processed\' and check_in_at__c = null and last_name__c >= \'#{a.upcase}\' and last_name__c < \'#{next_letter}\'" order_stmt = self.order_by(last_name__c: "ASC") self.query_with_reg_item_codes(where_stmt, order_stmt) end diff --git a/lib/sf/version.rb b/lib/sf/version.rb index da0b2a0..07653bb 100644 --- a/lib/sf/version.rb +++ b/lib/sf/version.rb @@ -1,3 +1,3 @@ module Sf - VERSION = "0.1.48" + VERSION = "0.1.49" end