I’m pretty sure we could pass the results of this AR query to an InvoiceSerializer:
class Api::V1::RevenueController < ApplicationController
def show
render json: InvoiceSerializer.new(Invoice.unshipped_revenue(quantity = 10))
end
end
I’m pretty sure we could pass the results of this AR query to an InvoiceSerializer:
class Api::V1::RevenueController < ApplicationController
def show
render json: InvoiceSerializer.new(Invoice.unshipped_revenue(quantity = 10))
end
end
Generate a new project without the included testing and with a postgres database:
rails new MyApp --skip-turbolinks --skip-spring -T --database=postgresql
Add VCR
group :test do
gem 'vcr'
gem 'webmock'
This exercise is intended to help you assess your progress with the concepts and techniques we've covered during the week.
For these questions, write a short snippet of code that meets
the requirement. Fill in your answers on a second sheet of paper or in your
notebook. In cases where the question mentions a "given"
data value, use the variable given
to refer to it (instead of re-writing
the information).