Class: Spree::Api::V2::Storefront::TripPlacesController

Inherits:
ResourceController
  • Object
show all
Defined in:
app/controllers/spree/api/v2/storefront/trip_places_controller.rb

Instance Method Summary collapse

Instance Method Details

#collectionObject

override



7
8
9
10
11
12
13
14
15
16
# File 'app/controllers/spree/api/v2/storefront/trip_places_controller.rb', line 7

def collection
  base_scope = model_class.joins(:location_vendor_places).distinct

  if params[:q].present?
    @search = base_scope.ransack(params[:q])
    @search.result
  else
    base_scope
  end
end

#collection_serializerObject



22
23
24
# File 'app/controllers/spree/api/v2/storefront/trip_places_controller.rb', line 22

def collection_serializer
  SpreeCmCommissioner::V2::Storefront::TripPlaceSerializer
end

#model_classObject



18
19
20
# File 'app/controllers/spree/api/v2/storefront/trip_places_controller.rb', line 18

def model_class
  SpreeCmCommissioner::Place
end