Class: Workarea::Api::Admin::ApplicationController
- Inherits:
-
Workarea::ApplicationController
- Object
- Workarea::ApplicationController
- Workarea::Api::Admin::ApplicationController
show all
- Includes:
- CurrentRelease, Swagger::Blocks
- Defined in:
- app/controllers/workarea/api/admin/application_controller.rb
Direct Known Subclasses
CategoriesController, CategoryProductRulesController, ContentAssetsController, ContentController, DiscountsController, EmailSignupsController, FulfillmentsController, InventorySkusController, NavigationMenusController, NavigationTaxonsController, OrdersController, PagesController, PaymentProfilesController, PaymentTransactionsController, PaymentsController, PricesController, PricingSkusController, ProductImagesController, ProductsController, PromoCodeListsController, RecommendationSettingsController, RedirectsController, ReleasesController, SavedAddressesController, SavedCreditCardsController, ShippingRatesController, ShippingServicesController, ShippingsController, SwaggerController, TaxCategoriesController, TaxRatesController, UsersController, VariantsController
Instance Method Summary
collapse
Instance Method Details
#current_user ⇒ Object
19
20
21
22
23
24
25
26
27
|
# File 'app/controllers/workarea/api/admin/application_controller.rb', line 19
def current_user
return @current_user if defined?(@current_user)
if user = authenticate_with_http_basic { |u, p| Api::Admin.authenticate(u, p) }
@current_user = user
else
request_http_basic_authentication
end
end
|
#sort_direction ⇒ Object
33
34
35
36
37
38
39
|
# File 'app/controllers/workarea/api/admin/application_controller.rb', line 33
def sort_direction
if params[:sort_direction].in?(%w(asc desc))
params[:sort_direction]
else
:desc
end
end
|
#sort_field ⇒ Object
29
30
31
|
# File 'app/controllers/workarea/api/admin/application_controller.rb', line 29
def sort_field
params[:sort_by].presence || :created_at
end
|