Represent Global IDs URIs: gid://basecamp/Todo/1234

(Moved from #16)

* Share Global IDs among collaborating apps and with non-Ruby/Rails code
* Well-known format with parsers & generators already implemented
* Pave the way to put verifier signature in the URI params, or e.g. a "?version=456" optimistic lock

Next steps:
* [ ] Beef up the URI parser
* [ ] Integrate signing into the URI as a query param
* [ ] Introduce an opaque, url-safe base64 #to_param
I say we define #id on ActiveModel.

On Aug 13, 2014, at 15:21, Rafael Mendonça França <notifications@github.com> wrote:

> In lib/active_model/global_id.rb:
> 
> >  
> >  module ActiveModel
> >    autoload :GlobalLocator,  'active_model/global_locator'
> >    autoload :SignedGlobalID, 'active_model/signed_global_id'
> >  
> >    class GlobalID
> > -    def self.create(model)
> > -      new "GlobalID-#{model.class.name}-#{model.id}"
> > +    class << self
> > +      attr_accessor :app
> > +
> > +      def create(model)
> > +        new URI("gid://#{GlobalID.app}/#{model.class.name}/#{model.id}")
> 
> to_key needs to always return an array.
> …
> —
> Reply to this email directly or view it on GitHub.
>