Ask A Question

Notifications

You’re not receiving notifications from this thread.

How do I configure GlobalID in a Rails app?

Walter Davis asked in Rails

I am working through an elaboration on the recent screencast, using GlobalID to build references to polymorphic associations, but I need to be able to take advantage of the GlobalID.app= method, and I can't seem to find a way to hook that in the application startup. I've tried an initializer and also adding that method to the application.rb in the initialization block. Can you recommend a place where I can set the name of the app for all instances of GlobalID?

Reply

Of course, the moment I write this, I found the answer by reading the code in the railtie for the gem:

# application.rb, inside the main block:
  config.global_id.app = 'wakka'

Hope this helps someone else...

Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 82,464+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.