mirror of
https://github.com/we-promise/sure.git
synced 2026-05-12 23:25:00 +00:00
Providers sharing (#1273)
* third party provider scoping * Simplify logic and allow only admins to mange providers * Broadcast fixes * FIX tests and build * Fixes * Reviews * Scope merchants * DRY fixes
This commit is contained in:
@@ -6,6 +6,8 @@ class IncomeStatement::CategoryStats
|
||||
end
|
||||
|
||||
def call
|
||||
return [] if @account_ids&.empty?
|
||||
|
||||
ActiveRecord::Base.connection.select_all(sanitized_query_sql).map do |row|
|
||||
StatRow.new(
|
||||
category_id: row["category_id"],
|
||||
@@ -50,7 +52,7 @@ class IncomeStatement::CategoryStats
|
||||
end
|
||||
|
||||
def scope_to_account_ids_sql
|
||||
return "" if @account_ids.blank?
|
||||
return "" if @account_ids.nil?
|
||||
ActiveRecord::Base.sanitize_sql([ "AND a.id IN (?)", @account_ids ])
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user