Have a look at this episode to see if it covers your questions.
You could use a UUID for this, but I think that it would probably be a bit overkill.
I would personally just do something like this with SecureRandom.hex (which is part of the ruby core)
before_create :populate_subscriber_id
private
def populate_subscriber_id
begin
self.subscriber_id = SecureRandom.hex
end while self.class.exists?(subscriber_id: subscriber_id)
end
Since the difference was so minimal, it was probably something to do with the host environment. If it were X times slower, it would be a bit strange and cause for alarm, but I could have had a number of things running on the mac which created the slight differences.
Yes. I've used similar things from this episode on some projects. My breadcrumbs were a bit different so the markup changed a bit, but the overall concept is the same. I've used similar approaches on SEO data as well (page titles and descriptions).
Really cool! Another idea for your gem, allow a block with the listing of columns. Kind of like a small DSL for the ordering and selection of columns.
I've been working on a project which takes the ideas of the Datatables and is basically a full rewrite; allowing pagination, individual column searching, column selection and ordering, saving custom reports and setting defaults, etc. It's a pretty large library so far, but not ready to share with the world.