diff options
author | HombreLaser <sebastian-440@live.com> | 2023-04-01 12:00:33 -0600 |
---|---|---|
committer | HombreLaser <sebastian-440@live.com> | 2023-04-01 12:00:33 -0600 |
commit | 753bf8499ba5d8815db8d08a1dcf69caa20660cf (patch) | |
tree | c758e18e3009f9c6da002164686e88956430847b /app/controllers/serializers | |
parent | 64214e370778dc3efdaca85acd0cd7a569a79b81 (diff) |
Mejora estructura del proyecto
Diffstat (limited to 'app/controllers/serializers')
6 files changed, 0 insertions, 65 deletions
diff --git a/app/controllers/serializers/address_serializer.rb b/app/controllers/serializers/address_serializer.rb deleted file mode 100644 index d86b134..0000000 --- a/app/controllers/serializers/address_serializer.rb +++ /dev/null @@ -1,8 +0,0 @@ -# frozen_string_literal: true - -module Serializers - # AddressSerializer - class AddressSerializer < BaseSerializer - attributes :id, :number, :street, :zip_code, :country, :city - end -end diff --git a/app/controllers/serializers/base_serializer.rb b/app/controllers/serializers/base_serializer.rb deleted file mode 100644 index bead772..0000000 --- a/app/controllers/serializers/base_serializer.rb +++ /dev/null @@ -1,8 +0,0 @@ -# frozen_string_literal: true - -module Serializers - # The father class of all serializers. - class BaseSerializer - include JSONAPI::Serializer - end -end diff --git a/app/controllers/serializers/card_serializer.rb b/app/controllers/serializers/card_serializer.rb deleted file mode 100644 index ba97443..0000000 --- a/app/controllers/serializers/card_serializer.rb +++ /dev/null @@ -1,8 +0,0 @@ -# frozen_string_literal: true - -module Serializers - # CardSerializer - class CardSerializer < BaseSerializer - attributes :id, :number, :expiration_year, :expiration_month, :expiration_day, :security_code - end -end diff --git a/app/controllers/serializers/company_serializer.rb b/app/controllers/serializers/company_serializer.rb deleted file mode 100644 index d211e9e..0000000 --- a/app/controllers/serializers/company_serializer.rb +++ /dev/null @@ -1,14 +0,0 @@ -# frozen_string_literal: true - -module Serializers - # CompanySerializer - class CompanySerializer < BaseSerializer - extend ActionView::RoutingUrlFor - - attributes :id, :name, :country, :short_name - - attribute :logo do |object| - object.logo.url - end - end -end diff --git a/app/controllers/serializers/product_serializer.rb b/app/controllers/serializers/product_serializer.rb deleted file mode 100644 index 7fb2874..0000000 --- a/app/controllers/serializers/product_serializer.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -module Serializers - # ProductSerializer - class ProductSerializer < BaseSerializer - include Rails.application.routes.url_helpers - extend ActionView::RoutingUrlFor - - attributes :name, :public_id, :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 } - end - end -end diff --git a/app/controllers/serializers/user_account_serializer.rb b/app/controllers/serializers/user_account_serializer.rb deleted file mode 100644 index 09379c4..0000000 --- a/app/controllers/serializers/user_account_serializer.rb +++ /dev/null @@ -1,8 +0,0 @@ -# frozen_string_literal: true - -module Serializers - # The serializer for the user account model. - class UserAccountSerializer < BaseSerializer - attributes :email, :first_name, :last_name, :role - end -end |