Sha256: c96b0fcb55be1d6aa314eaea8856460a461e8a38e6e9a0360100fc15790152ca

Contents?: true

Size: 581 Bytes

Versions: 6

Compression:

Stored size: 581 Bytes

Contents

# frozen_string_literal: true

module Rails
  module GraphQL
    module Helpers
      # Helper module that is a different implementation of the
      # +GlobalID::Identification+, but instead of things being found by the
      # class that they are, it uses owners and base classes.
      module WithGlobalID
        def to_global_id(options = nil)  # :nodoc:
          GlobalID.create(self, options)
        end

        alias to_gid to_global_id

        def to_gid_param(options = nil)  # :nodoc:
          to_global_id(options).to_param
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rails-graphql-1.0.2 lib/rails/graphql/helpers/with_global_id.rb
rails-graphql-1.0.1 lib/rails/graphql/helpers/with_global_id.rb
rails-graphql-1.0.0 lib/rails/graphql/helpers/with_global_id.rb
rails-graphql-1.0.0.rc2 lib/rails/graphql/helpers/with_global_id.rb
rails-graphql-1.0.0.rc1 lib/rails/graphql/helpers/with_global_id.rb
rails-graphql-1.0.0.beta lib/rails/graphql/helpers/with_global_id.rb