Given two models, what is the issue with the query used to fetch them?
class LineItem < ApplicationRecord
end
class Order < ApplicationRecord
has_many :line_items
end
Order.limit(3).each { |order| puts order.line_items }
Given two models, what is the issue with the query used to fetch them?
class LineItem < ApplicationRecord
end
class Order < ApplicationRecord
has_many :line_items
end
Order.limit(3).each { |order| puts order.line_items }