diff options
author | HombreLaser <sebastian-440@live.com> | 2023-03-16 22:34:51 -0600 |
---|---|---|
committer | HombreLaser <sebastian-440@live.com> | 2023-03-16 22:34:51 -0600 |
commit | f68124a6dff2b0b6131280be2378a049d9d839d4 (patch) | |
tree | 4c515695f88b23bf85bbd0e4f66dc6f80b96673a /app/controllers/serializers | |
parent | 69153b46eee0fec67efa66f9b5f0499730a98829 (diff) |
Mejora las queries
Diffstat (limited to 'app/controllers/serializers')
-rw-r--r-- | app/controllers/serializers/product_serializer.rb | 7 |
1 files changed, 4 insertions, 3 deletions
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 |