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