Class: SpaceCalculator::LocationContainerLookup

Inherits:
Object
  • Object
show all
Defined in:
backend/app/model/space_calculator.rb

Overview

Encapsulate our DB queries for efficiently getting the location/container/profile information we need.

Instance Method Summary collapse

Constructor Details

#initialize(locations) ⇒ LocationContainerLookup

Returns a new instance of LocationContainerLookup.



143
144
145
# File 'backend/app/model/space_calculator.rb', line 143

def initialize(locations)
  calculate(locations)
end

Instance Method Details

#container_profiles_at_location(location) ⇒ Object



152
153
154
155
# File 'backend/app/model/space_calculator.rb', line 152

def container_profiles_at_location(location)
  #TopContainer.find_relationship(:top_container_housed_at).who_participates_with(location)
  Array(@locations_to_container_profiles[location.id])
end

#location_profile_for(location) ⇒ Object



147
148
149
150
# File 'backend/app/model/space_calculator.rb', line 147

def location_profile_for(location)
  #location.related_records(:location_profile)
  @locations_to_location_profiles[location.id]
end