Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Criar modelo de usuário (1/2) #25

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Criar modelo de usuário (1/2) #25

wants to merge 1 commit into from

Conversation

ghost
Copy link

@ghost ghost commented Sep 1, 2022

Qual é o propósito deste Pull Request?

O que foi feito para atingir isso?

  • Foi gerado o modelo de usuário com todos os campos necessários

@ghost ghost added the enhancement New feature or request label Sep 1, 2022
@ghost ghost assigned Jhonny4975 and ghost Sep 1, 2022
@ghost ghost requested review from Jhonny4975, marcelotoledo5000 and a team and removed request for marcelotoledo5000 and Jhonny4975 September 1, 2022 20:32
Jhonny4975
Jhonny4975 previously approved these changes Sep 1, 2022
Co-Authored-By: Jhonny Toledo <jhonnytoledo4975@gmail.com>
@Jhonny4975 Jhonny4975 requested a review from a team September 1, 2022 20:39
@codecov-commenter
Copy link

Codecov Report

Merging #25 (bf318f1) into main (898c0e5) will increase coverage by 37.50%.
The diff coverage is 100.00%.

@@             Coverage Diff              @@
##             main       #25       +/-   ##
============================================
+ Coverage   62.50%   100.00%   +37.50%     
============================================
  Files           6         7        +1     
  Lines          16        17        +1     
============================================
+ Hits           10        17        +7     
+ Misses          6         0        -6     
Impacted Files Coverage Δ
app/controllers/application_controller.rb 100.00% <100.00%> (ø)
app/models/user.rb 100.00% <100.00%> (ø)
app/jobs/application_job.rb 100.00% <0.00%> (+100.00%) ⬆️
app/mailers/application_mailer.rb 100.00% <0.00%> (+100.00%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link
Contributor

@marcelotoledo5000 marcelotoledo5000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👀

Qual é a ideia aqui de 1/2 ? Esse aqui já tem que ter os testes, e não pode diminuir o coverage... Inclusive isso nos mostra que o CI ainda não está validando a cobertura direito, pq nao era nem pra ele aprovar esse PR... depois arrumo isso, mas, to de olho!!!


class User < ApplicationRecord
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :validatable
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Acho que aqui já vale criar as validações do modelo né, campos que queremos que seja obrigatório e único, por exemplo o email..., password (inclusive com tamanho mínimo que se bem me lembro são 8)... etc

# t.string :unlock_token # Only if unlock strategy is :email or :both
# t.datetime :locked_at

t.string :user_id, null: false, index: { unique: true }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

esse cara aqui acho que está errado né, pq já é a tabela de usuário, que user_id seria esse?

t.string "reset_password_token"
t.datetime "reset_password_sent_at"
t.datetime "remember_created_at"
t.string "user_id", null: false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Realmente tá errado isso aqui...


FactoryBot.define do
factory :user do
name { '' }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cadê o faker aqui? Já cria a factory fazendo ela funcionar bonitinha...

require 'rails_helper'

RSpec.describe User, type: :model do
pending "add some examples to (or delete) #{__FILE__}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants