Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/marnen/cpk_sample
Tests of composite_primary_keys Rails plugin, for discussion at http://www.ruby-forum.com/topic/195472 .
https://github.com/marnen/cpk_sample
Last synced: 6 days ago
JSON representation
Tests of composite_primary_keys Rails plugin, for discussion at http://www.ruby-forum.com/topic/195472 .
- Host: GitHub
- URL: https://github.com/marnen/cpk_sample
- Owner: marnen
- Created: 2009-10-21T21:03:27.000Z (over 15 years ago)
- Default Branch: master
- Last Pushed: 2009-10-21T21:10:09.000Z (over 15 years ago)
- Last Synced: 2024-12-10T05:42:29.011Z (2 months ago)
- Language: Ruby
- Homepage:
- Size: 152 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README
Awesome Lists containing this project
README
My description from http://www.ruby-forum.com/topic/195472:
I created a sample app testing composite_primary_keys, which is up on Github at http://github.com/marnen/cpk_sample if you want to play around with it. The app uses one table (entries) with three integer fields (alpha, beta, gamma) and no id field. There are several branches:
* no_index_nil_keys -- no index on DB table, Entry.set_primary_keys nil. Doesn't work.
* no_index_all_keys -- no index on DB table, Entry.set_primary_keys :alpha, :beta, :gamma. Works for reading and writing (that is, Entry.create and Entry.all both work as expected).
* all_index_all_keys -- primary key(alpha beta gamma) on DB table, Entry.set_primary_keys :alpha, :beta, :gamma. Works for reading and writing.
I think you were getting the error in a no_index_all_keys situation, and I cannot reproduce that error. I'm using Mac OS X 10.6.1, Ruby 1.8.7, Rails 2.3.4, composite_primary_keys 2.3.2, and PostgreSQL 8.4.1. Let me know if you get different results with my code...