Posts by wilfrank • 1 point
2 posts
-
0
votes2
answers226
viewsA: Rendering a JSON object with the merging of different models
I managed to solve it! I arrived at the result I needed with the following method: def parts part_numbers = self.quotation_items.map { |item| item.part_number } parts = part_numbers.map { |item|…
-
0
votes2
answers226
viewsQ: Rendering a JSON object with the merging of different models
I am developing an API with Rails 5 and have the following models: class cotacao < ApplicationRecord belongs_to :usuario has_many :cotacao_itens, dependent: :destroy accepts_nested_attributes_for…