Skip to content

Instantly share code, notes, and snippets.

@nertzy
Created December 12, 2014 20:31
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save nertzy/bc2cb5d92412a283a291 to your computer and use it in GitHub Desktop.
Rails bug
require "bundler"
Bundler.setup
require "active_record"
ActiveRecord::Base.logger = Logger.new(STDOUT)
ActiveRecord::Base.establish_connection(:adapter => "sqlite3", :database => ':memory:')
class TestModel < ActiveRecord::Base; end
connection = ActiveRecord::Base.connection
connection.create_table(:test_models)
record = TestModel.create! # => succeeds
record.reload # => raises error
source "https://rubygems.org"
gem "activerecord", github: "rails"
gem "sqlite3"
GIT
remote: git://github.com/rails/rails.git
revision: 46617f02c6e473b7e695330076d2039de1c9aff2
specs:
activemodel (5.0.0.alpha)
activesupport (= 5.0.0.alpha)
builder (~> 3.1)
activerecord (5.0.0.alpha)
activemodel (= 5.0.0.alpha)
activesupport (= 5.0.0.alpha)
arel (~> 6.0)
activesupport (5.0.0.alpha)
i18n (>= 0.7.0.beta1, < 0.8)
json (~> 1.7, >= 1.7.7)
minitest (~> 5.1)
thread_safe (~> 0.1)
tzinfo (~> 1.1)
GEM
remote: https://rubygems.org/
specs:
arel (6.0.0)
builder (3.2.2)
i18n (0.7.0.beta1)
json (1.8.1)
minitest (5.4.3)
sqlite3 (1.3.10)
thread_safe (0.3.4)
tzinfo (1.2.2)
thread_safe (~> 0.1)
PLATFORMS
ruby
DEPENDENCIES
activerecord!
sqlite3
D, [2014-12-12T14:31:27.235390 #13773] DEBUG -- :  (0.3ms) CREATE TABLE "test_models" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL) 
D, [2014-12-12T14:31:27.239085 #13773] DEBUG -- :  (0.0ms) begin transaction
D, [2014-12-12T14:31:27.240748 #13773] DEBUG -- : SQL (0.0ms) INSERT INTO "test_models" DEFAULT VALUES
D, [2014-12-12T14:31:27.240928 #13773] DEBUG -- :  (0.0ms) commit transaction
D, [2014-12-12T14:31:27.243074 #13773] DEBUG -- : TestModel Load (0.1ms) SELECT "test_models".* WHERE "test_models"."id" = ? LIMIT 1 [["id", 1]]
E, [2014-12-12T14:31:27.243098 #13773] ERROR -- : SQLite3::SQLException: no such table: test_models: SELECT "test_models".* WHERE "test_models"."id" = ? LIMIT 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment