Commit 730c1333 authored by Mateus Ravedutti's avatar Mateus Ravedutti

Merge with Issue#27

parents c25e38f2 d8e9a5cb
Pipeline #6602 passed with stage
in 6 minutes and 9 seconds
class Professional < ApplicationRecord
# Associations #
belongs_to :account
has_one :citizen, through: :account
has_many :professionals_service_places
has_many :service_places, :through => :professionals_service_places
......
class ProfessionalSerializer < ActiveModel::Serializer
ActiveModelSerializers.config.default_includes = '**'
attributes :id, :registration, :active
has_one :account
has_one :citizen, through: :account
end
......@@ -49,7 +49,7 @@ class Api::V1::ProfessionalsControllerTest < ActionDispatch::IntegrationTest
end
it "should correspond to the professional in the database" do
assert_equal @body["account"]["citizen"]["cpf"], Professional.find(@professional.id).account.citizen.cpf
assert_equal @body["citizen"]["cpf"], Professional.find(@professional.id).account.citizen.cpf
end
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment