Skip to content

Instantly share code, notes, and snippets.

@jonleighton
Created December 14, 2011 16:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jonleighton/1477369 to your computer and use it in GitHub Desktop.
Save jonleighton/1477369 to your computer and use it in GitHub Desktop.
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