Browse Source

fixes

pull/1776/head
Kat 3 years ago
parent
commit
e7ac1ee407
  1. 2
      app/controllers/lettings_logs_controller.rb
  2. 2
      app/controllers/sales_logs_controller.rb
  3. 2
      app/models/lettings_log.rb

2
app/controllers/lettings_logs_controller.rb

@ -22,7 +22,7 @@ class LettingsLogsController < LogsController
@total_count = all_logs.size @total_count = all_logs.size
@unresolved_count = all_logs.unresolved.created_by(current_user).count @unresolved_count = all_logs.unresolved.created_by(current_user).count
@filter_type = "lettings_logs" @filter_type = "lettings_logs"
@duplicate_sets_count = duplicate_sets_count(current_user, nil) @duplicate_sets_count = current_user.support? ? 0 : duplicate_sets_count(current_user, nil)
render "logs/index" render "logs/index"
end end

2
app/controllers/sales_logs_controller.rb

@ -24,7 +24,7 @@ class SalesLogsController < LogsController
@searched = search_term.presence @searched = search_term.presence
@total_count = all_logs.size @total_count = all_logs.size
@filter_type = "sales_logs" @filter_type = "sales_logs"
@duplicate_sets_count = duplicate_sets_count(current_user, nil) @duplicate_sets_count = current_user.support? ? 0 : duplicate_sets_count(current_user, nil)
render "logs/index" render "logs/index"
end end

2
app/models/lettings_log.rb

@ -53,6 +53,8 @@ class LettingsLog < Log
scope :after_date, ->(date) { where("lettings_logs.startdate >= ?", date) } scope :after_date, ->(date) { where("lettings_logs.startdate >= ?", date) }
scope :unresolved, -> { where(unresolved: true) } scope :unresolved, -> { where(unresolved: true) }
scope :filter_by_organisation, ->(org, _user = nil) { where(owning_organisation: org).or(where(managing_organisation: org)) } scope :filter_by_organisation, ->(org, _user = nil) { where(owning_organisation: org).or(where(managing_organisation: org)) }
scope :filter_by_owning_organisation, ->(owning_organisation, _user = nil) { where(owning_organisation:) }
scope :filter_by_managing_organisation, ->(managing_organisation, _user = nil) { where(managing_organisation:) }
scope :age1_answered, -> { where.not(age1: nil).or(where(age1_known: 1)) } scope :age1_answered, -> { where.not(age1: nil).or(where(age1_known: 1)) }
scope :tcharge_answered, -> { where.not(tcharge: nil).or(where(household_charge: 1)).or(where(is_carehome: 1)) } scope :tcharge_answered, -> { where.not(tcharge: nil).or(where(household_charge: 1)).or(where(is_carehome: 1)) }
scope :chcharge_answered, -> { where.not(chcharge: nil).or(where(is_carehome: [nil, 0])) } scope :chcharge_answered, -> { where.not(chcharge: nil).or(where(is_carehome: [nil, 0])) }

Loading…
Cancel
Save