diff options
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 |