Skip to content

Instantly share code, notes, and snippets.

set nocompatible
set viminfo='20,\"500 " Keep a .viminfo file.
" When editing a file, always jump to the last cursor position
autocmd BufReadPost *
\ if ! exists("g:leave_my_cursor_position_alone") |
\ if line("'\"") > 0 && line ("'\"") <= line("$") |
\ exe "normal g'\"" |
\ endif |
require 'spec_helper'
describe Book do
it "has same join behavior for logically equivalent subqueries" do
author = Author.create
book = Book.create!(cost: 100, author: author)
2.times { Chapter.create!(book: book) }
sub_query1 = Book.arel_table[:author_id].in([author.id])
sub_query2 = Book.arel_table[:author_id].in(