From 6f03e6cb71aefb08cdd731b792f4a53d435cc789 Mon Sep 17 00:00:00 2001 From: emiko Date: Thu, 10 Apr 2014 16:22:16 +0900 Subject: [PATCH] get removed items --- app/models/ndl_statistic.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/models/ndl_statistic.rb b/app/models/ndl_statistic.rb index 8bf5709..5ddb57c 100644 --- a/app/models/ndl_statistic.rb +++ b/app/models/ndl_statistic.rb @@ -70,8 +70,11 @@ def calc_manifestation_counts query += " AND circulation_status_id = #{@circulation_removed_id}" query += " AND removed_at between ? and ?" if type == "removed" end - items_all = type == "removed" ? Item.joins(:manifestation).where(query, @curr_term_end, @prev_term_end, @curr_term_end): - Item.joins(:manifestation).where(query, @curr_term_end) + if type == "removed" + items_all = Item.joins(:manifestation).where(query, @curr_term_end, @prev_term_end, @curr_term_end) + else + items_all = Item.joins(:manifestation).where(query, @curr_term_end) + end # 日本、外国 REGION_LIST.each do |region|