Example code to refactor complex queries in an object oriented fashion
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
database
lib
spec
.gitignore
.rspec
.ruby-version
Gemfile
Gemfile.lock
README.md

README.md

How to isolate complex queries in an object oriented fashion

This repository contains the example code of the blog post How to isolate complex queries in an object oriented fashion

Setup

  • Run bundle install
  • Create a local MySql database called football_blog_post and run bundle exec database/init.rb to setup the tables.
  • Run bundle exec rspec to assess that TalentHunterWithNaiveQuery and the refactored TalentHunterWithQueryObject have the same behavior.