From f68124a6dff2b0b6131280be2378a049d9d839d4 Mon Sep 17 00:00:00 2001 From: HombreLaser Date: Thu, 16 Mar 2023 22:34:51 -0600 Subject: Mejora las queries --- app/controllers/serializers/product_serializer.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'app/controllers/serializers') diff --git a/app/controllers/serializers/product_serializer.rb b/app/controllers/serializers/product_serializer.rb index 09310a0..8e1ac11 100644 --- a/app/controllers/serializers/product_serializer.rb +++ b/app/controllers/serializers/product_serializer.rb @@ -3,16 +3,17 @@ module Serializers # ProductSerializer class ProductSerializer < BaseSerializer + include Rails.application.routes.url_helpers extend ActionView::RoutingUrlFor - attributes :name, :unitary_price, :bulk_price, :available_quantity, :categories, :company + attributes :name, :unitary_price, :bulk_price, :available_quantity, :categories attribute :picture do |object| object.picture.url end attribute :company do |object| - { name: object.company.name, short_name: object.company.short_name } + { name: object.company_name, short_name: object.company_short_name } end end -end \ No newline at end of file +end -- cgit v1.2.3