I have a php app and there there is some consideration about porting it to Rails.
One piece where it is unclear whether there is a prebuilt equivalent to a specific part. It has a table with a unique identifying system for objects. Not ALL objects participate in this system, just objects that are considered 'interesting'.
A simplified example:
user - uses system
id user_name
1 joe
2 frank
image - uses system
id url
1 /img/123.jpg
2 /img/234.jpg
comment - uses system
id comment
1 what are you doing?
2 this is great
global_identification
id object_type object_id
1 user 1
2 comment 1
3 image 1
4 user 2
5 image 2
6 comment 2
globals_lists
1 list_id global_id
2 1 3
3 1 6
This has simplified a lot of elements esp for list creations having only to have开发者_开发技巧 a global_identifiter rather than an object and an id. It's a php web app so essentially single-threaded.
This is essentially hand-rolled and am curious whether there is a rails equivalent of something like this? Also, talking with another developer, I was curious whether there is a name for this - it's kinda like a half-baked GUID system?
There is no in-language support for guid.
Here is a an articles that talks about guid: http://amthekkel.blogspot.com/2009/02/ruby-on-rails-how-to-use-guid-for-use.html
精彩评论