This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
while bundle exec rake test; do :; done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Make sure to have prepared statements enabled. | |
# config/database.yml | |
# test: | |
# database: ... | |
# prepared_statements: true | |
# Add this to the top scope of test/test_helper.rb or spec/rails_helper.rb and | |
# run tests as usual. | |
queries = Hash.new(0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Here's the problem statement we worked on: | |
# 1. Spam post detection: Run a forum post through a series of configurable checks to give it a spam score, | |
# and flag the post when it crosses the threshold, with details on what led to the score. | |
# We had a Gemfile with `gem "rails"` and `gem "sqlite3"` in it, but that was it. | |
require "bundler/setup" | |
require "active_record" | |
ActiveRecord::Base.establish_connection(adapter: "sqlite3", database: ":memory:") |
OlderNewer