Class: Spree::Api::V2::Storefront::HomepageSectionsController
- Inherits:
-
ResourceController
- Object
- ResourceController
- Spree::Api::V2::Storefront::HomepageSectionsController
show all
- Defined in:
- app/controllers/spree/api/v2/storefront/homepage_sections_controller.rb
Instance Method Summary
collapse
Instance Method Details
#collection ⇒ Object
18
19
20
21
22
23
24
|
# File 'app/controllers/spree/api/v2/storefront/homepage_sections_controller.rb', line 18
def collection
@collection ||= model_class.filter_by_segment(params[:homepage_id] || :general)
.active
.where(tenant_id: nil)
.where(preview: false)
.order(position: :asc)
end
|
#collection_serializer ⇒ Object
10
11
12
|
# File 'app/controllers/spree/api/v2/storefront/homepage_sections_controller.rb', line 10
def collection_serializer
Spree::V2::Storefront::HomepageSectionSerializer
end
|
#model_class ⇒ Object
6
7
8
|
# File 'app/controllers/spree/api/v2/storefront/homepage_sections_controller.rb', line 6
def model_class
SpreeCmCommissioner::HomepageSection
end
|
#resource_serializer ⇒ Object
14
15
16
|
# File 'app/controllers/spree/api/v2/storefront/homepage_sections_controller.rb', line 14
def resource_serializer
Spree::V2::Storefront::HomepageSectionSerializer
end
|