lib/masterfiles/repositories/location_repo.rb
# Get the count of all pallets in a location.
# If recursive is true, get the count of pallets in the location and all its sub-locations.
Get the count of all pallets in a location.
If recursive is true, get the count of pallets in the location and all its sub-locations.
Get the count of all pallets in a location . If recursive is true get the count of pallets in the location and all its sub - locations .
def location_pallets_count(location_id, recursive: false)
      return DB[:pallets].where(location_id: location_id).count unless recursive
      location_ids = DB[:tree_locations].where(ancestor_location_id: location_id).select_map(:descendant_location_id)
      DB[:pallets].where(location_id: location_ids).count
    end
def location_pallets_count ( location_id , recursive : false ) return DB [ :pallets ] . where ( location_id : location_id ) . count unless recursive location_ids = DB [ :tree_locations ] . where ( ancestor_location_id : location_id ) . select_map ( :descendant_location_id ) DB [ :pallets ] . where ( location_id : location_ids ) . count end
Get the count of all pallets in a location.
Get the count of all pallets in a location .
location_id
<not_specific>
recursive
<not_specific>