Class: Spree::Api::V2::Tenant::HomepageSectionsController
- Inherits:
-
BaseController
- Object
- ResourceController
- BaseController
- Spree::Api::V2::Tenant::HomepageSectionsController
show all
- Defined in:
- app/controllers/spree/api/v2/tenant/homepage_sections_controller.rb
Instance Method Summary
collapse
#render_serialized_payload, #require_tenant
Instance Method Details
#collection ⇒ Object
6
7
8
9
10
|
# File 'app/controllers/spree/api/v2/tenant/homepage_sections_controller.rb', line 6
def collection
@collection ||= scope.filter_by_segment(params[:homepage_id] || :general)
.active
.order(position: :asc)
end
|
#collection_serializer ⇒ Object
#resource_serializer ⇒ Object
#scope ⇒ Object
12
13
14
15
16
|
# File 'app/controllers/spree/api/v2/tenant/homepage_sections_controller.rb', line 12
def scope
MultiTenant.with(@tenant) do
model_class.where(tenant_id: MultiTenant.current_tenant_id)
end
end
|