Search code examples
ruby-on-rails-5rolify

RoR roles management - rolify gem - use with resources of both UUID and Integer IDs


I saw the FAQ on UUIDs, but it changes the whole mechanism to use UUID. How can I cope with some of my tables use UUID and some regular integer ID?

Thanks a log


Solution

  • Well, you should just add a migrations to the database tables that you want to use UUID on. rails g migration add_uuid_to_sometablename , and should be sufficient.

    And if you need to index that particular column, you can say like

    add_index(:yourtablename, :uuid, unique: true)