Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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 .

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...