-
Notifications
You must be signed in to change notification settings - Fork 34
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
Add product to deal #322
Conversation
…tag to notifications
def deal_products | ||
@deal_products = @deal.deal_products | ||
end | ||
|
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
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 |
There was a problem hiding this comment.
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
end | ||
context 'update product' do | ||
it do | ||
patch "/accounts/#{account.id}/deals/#{deal.id}/update_product?deal_product_id=#{deal_product.id}", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Masssa!
No description provided.