Forum: Ruby on Rails Issues using GUID plugin: IDs and acts_as_versioned

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Justin C. (Guest)
on 2006-05-06 07:37
(Received via mailing list)

First off, I think the GUID plugin is very slick (  However, I'm
running into a few issues:

ISSUE #1) Rails' handling of IDs as strings instead of integers.  In
particular, it didn't seem to work when I had a model doing
with a scope:


Class Big < ActiveRecord::Base
  has_many :littles

Class Little < ActiveRecord::Base
  belongs_to :big
  acts_as_list :scope => big_id

It seems like the generated SQL queries wouldn't put the ID with string
quotations.  I get an error like:
Mysql::Error: Unknown column 'ayMi4o3iyr2OYfabBlKsEs' in 'where clause':
SELECT * FROM littles WHERE (big_id = ayMi4o3iyr2OYfabBlKsEs)  ORDER BY
position DESC  LIMIT 1

ISSUE #2) acts_as_versioned method "create_versioned_tables" assumes
for the foreign key id of the table to be versioned

Example: (using the same class as above)  It will generate a
table with:
- id int (this is fine)
- big_id int (this should be a string since tables "bigs" has an ID that
a string)

Question: For either issue, is there a setting I could change that maybe
missing?  Otherwise, I'll probably not use the acts_as_list at this time
(for issue #1) and modify the create_versioned_table to do a string
of integer for this case (for issue #2).


Justin C.
Co-President, Co-Founder
Two-Bit Operation LLC
This topic is locked and can not be replied to.