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

Add product to deal #322

Merged
merged 26 commits into from
May 22, 2024
Merged

Add product to deal #322

merged 26 commits into from
May 22, 2024

Conversation

YukioArie
Copy link
Collaborator

No description provided.

@YukioArie YukioArie requested a review from douglara May 12, 2024 03:11
app/models/account.rb Outdated Show resolved Hide resolved
app/models/deal.rb Outdated Show resolved Hide resolved
app/views/accounts/deals/_details.html.erb Outdated Show resolved Hide resolved
app/views/components/_notifications.html.erb Outdated Show resolved Hide resolved
app/views/components/_notifications.html.erb Outdated Show resolved Hide resolved
Comment on lines +138 to +141
def deal_products
@deal_products = @deal.deal_products
end

Copy link
Owner

Choose a reason for hiding this comment

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

Aquele ponto da action ter dois comportamentos uma para o product e outra para o deal_product podemos ou colocar nesse controller do deal ou no controller deal_product

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Acho interessante deixar no deal msm, pq nesse caso ele vai exibir o deal_product somente na pagina do deal. Igual a logica dos events. As duas actions de listagem dos eventos, events_to_do e events_done, estão no deal, e n no controller events, pq a listagem desses eventos estão sendo renderizados na pagina do deal.

@YukioArie YukioArie requested a review from douglara May 21, 2024 03:54
Comment on lines 179 to 182
def product_params
params.require(:product).permit(:identifier, :amount_in_cents, :quantity_available, :description, :name,
attachments_attributes: %i[file _destroy id], custom_attributes: {}, additional_attributes: {})
end
Copy link
Owner

Choose a reason for hiding this comment

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

Dei um up aqui para evitar a duplicação

12d6861

app/views/accounts/deals/edit_product.html.erb Outdated Show resolved Hide resolved
app/views/components/_flash_message.html.erb Outdated Show resolved Hide resolved
end
context 'update product' do
it do
patch "/accounts/#{account.id}/deals/#{deal.id}/update_product?deal_product_id=#{deal_product.id}",
Copy link
Owner

Choose a reason for hiding this comment

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

Masssa!

@douglara douglara merged commit dc4cc9d into development May 22, 2024
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants