Skip to content

Commit

Permalink
Division with addresses no need to be public.
Browse files Browse the repository at this point in the history
  • Loading branch information
glartor committed Nov 27, 2024
1 parent 6d43a3b commit 03e37a9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/api/v1/divisions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def index_with_address
#seed_commons_id = Division.find_by(name: "Seed Commons").id
seed_commons_division_ids = Division.find_by(name: "Seed Commons").self_and_descendants.pluck(:id)
#divisions = Division.includes(address: [:country, :geo_state]).where(parent_id: seed_commons_id, public: true)
divisions = Division.includes(address: [:country, :geo_state]).where(parent_id: seed_commons_division_ids, public: true).where.not(address_id: nil)
divisions = Division.includes(address: [:country, :geo_state]).where(parent_id: seed_commons_division_ids).where.not(address_id: nil)
render json: divisions.map { |division| format_division(division) }
end

Expand Down

0 comments on commit 03e37a9

Please sign in to comment.