On Github hqmq / presentation-rails-layers
Michael Ries
Twitter @hqmq_
Github @hqmq
class CreateCourseRecords < ActiveRecord::Migration ... endSo what would it take to make it work within our application? A Migration...
class CourseRecord < ActiveRecord::Base ... endA model
module UpdateCourseRecordsOnCreate extend ActiveSupport::Concern included do after_save :recalculate_records end endSome sort of observer to recalculate records when new games are created.
require 'sinatra' post '/game.json' do ...calculate records... end get '/:course_id/records.json' do endSo what would it take to make it work as a new service? A Sinatra app...