Skip to content

Commit

Permalink
Merge pull request #1284 from sparc-request/jl-service-batch-auditing…
Browse files Browse the repository at this point in the history
…-bug

Jl - service batch auditing bug
  • Loading branch information
Stuart-Johnson committed Apr 13, 2018
2 parents e3a357f + 550dfc7 commit 477f9ab
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/models/organization.rb
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,10 @@ def update_descendants_availability(is_available)
if is_available == "0"
children = Organization.where(id: all_child_organizations << self)
children.update_all(is_available: false)
Service.where(organization_id: children).update_all(is_available: false)
services = Service.where(organization_id: children)
services.each do |service|
service.update_attributes(is_available: false)
end
end
end

Expand Down

0 comments on commit 477f9ab

Please sign in to comment.