public
Created

  • Download Gist
bug_2807.rb
Ruby
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
require 'active_record'
 
ActiveRecord::Base.establish_connection(:adapter => 'sqlite3', :database => ':memory:')
 
ActiveRecord::Schema.define do
create_table :posts, :id => false do |t|
t.integer :foo
end
end
 
class Post < ActiveRecord::Base
self.primary_key = :foo
end
 
p = Post.create
p Post.primary_key

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.