@@ -49,7 +49,7 @@ def index
4949 @paginated_distributions = @distributions . page ( params [ :page ] )
5050 @items = current_organization . items . alphabetized . select ( :id , :name )
5151 @item_categories = current_organization . item_categories . select ( :id , :name )
52- @storage_locations = current_organization . storage_locations . active_locations . alphabetized . select ( :id , :name )
52+ @storage_locations = current_organization . storage_locations . active . alphabetized . select ( :id , :name )
5353 @partners = current_organization . partners . active . alphabetized . select ( :id , :name )
5454 @selected_item = filter_params [ :by_item_id ] . presence
5555 @distribution_totals = DistributionTotalsService . new ( current_organization . distributions , scope_filters )
@@ -122,7 +122,7 @@ def create
122122 @partner_list = current_organization . partners . where . not ( status : 'deactivated' ) . alphabetized
123123
124124 inventory = View ::Inventory . new ( @distribution . organization_id )
125- @storage_locations = current_organization . storage_locations . active_locations . alphabetized . select do |storage_loc |
125+ @storage_locations = current_organization . storage_locations . active . alphabetized . select do |storage_loc |
126126 inventory . quantity_for ( storage_location : storage_loc . id ) . positive?
127127 end
128128 if @distribution . storage_location . present?
@@ -157,7 +157,7 @@ def new
157157 @partner_list = current_organization . partners . where . not ( status : 'deactivated' ) . alphabetized
158158
159159 inventory = View ::Inventory . new ( current_organization . id )
160- @storage_locations = current_organization . storage_locations . active_locations . alphabetized . select do |storage_loc |
160+ @storage_locations = current_organization . storage_locations . active . alphabetized . select do |storage_loc |
161161 inventory . quantity_for ( storage_location : storage_loc . id ) . positive?
162162 end
163163 end
@@ -185,7 +185,7 @@ def edit
185185 . where ( storage_location_id : @distribution . storage_location_id )
186186 . where ( "updated_at > ?" , @distribution . created_at ) . any?
187187 inventory = View ::Inventory . new ( @distribution . organization_id )
188- @storage_locations = current_organization . storage_locations . active_locations . alphabetized . select do |storage_loc |
188+ @storage_locations = current_organization . storage_locations . active . alphabetized . select do |storage_loc |
189189 !inventory . quantity_for ( storage_location : storage_loc . id ) . negative?
190190 end
191191 else
@@ -212,7 +212,7 @@ def update
212212 @distribution . initialize_request_items
213213 @items = current_organization . items . active . alphabetized
214214 @partner_list = current_organization . partners . alphabetized
215- @storage_locations = current_organization . storage_locations . active_locations . alphabetized
215+ @storage_locations = current_organization . storage_locations . active . alphabetized
216216 render :edit
217217 end
218218 end
0 commit comments