Displaying 1 result from an estimated 1 matches for "pk_name".
Did you mean:
pkg_name
2010 Aug 19
1
Composite primary keys and :joins=>
...e, ...
Models:
class TableB < AR::Base
set_table_name ''table_b''
set_primary_key :an_id # singular PK
belongs_to :code_name, :class_name=>''TableA'', :primary_key=>:pk_code_name, :foreign_key=>:code
SELECT = "*, table_a.name AS pk_name"
def self.get_all
all(:select=>SELECT, :joins=>:code_name)
end
end
class TableA < AR::Base
set_table_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_na...