Create a gist now

Instantly share code, notes, and snippets.

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment