Sha256: ae90f20e95b3977f9386fc735844d1be7e702a46ce01334ab6c0d6e9be423a4c
Contents?: true
Size: 506 Bytes
Versions: 4
Compression:
Stored size: 506 Bytes
Contents
class BookStoreController < ApplicationController def show book = Book.find(params[:id]) render :nothing => true end context_for :purchase, BookStorePurchaseContext def purchase book = Book.find(params[:id]) user = User.find(session[:user_id]) user = user.in_context if defined?(Mongoid) user.testable? user.purchase(book) if user.purchased? render :nothing => true, :status => 201 else render :nothing => true, :status => 403 end end end
Version data entries
4 entries across 4 versions & 1 rubygems