search for: pk_code_key

Displaying 1 result from an estimated 1 matches for "pk_code_key".

2010 Aug 19
1
Composite primary keys and :joins=>
...ble_name ''table_a'' set primary_keys :type_key, :code_key # using the composite primary keys gem 2.3.2 def self.find_by_pk_code_name(*args) # pk method invoked by belongs_to in TableB opts = args.extract_options! pk_type_key = "FOOKEY" pk_code_key = args.first find([pk_type_key, pk_code_key], opts) rescue ActiveRecord::RecordNotFound end end Console: x=TableB.first x.code_name # works! TableB.get_all # fails: "element size differs (1 should be 2)" I believe this error is due to 2 PKs being defined f...