Sha256: 9250a01d093fa55cf3971774a82754186ec22f42d0ac349e3f29ff56abf4b8b2

Contents?: true

Size: 293 Bytes

Versions: 3

Compression:

Stored size: 293 Bytes

Contents

# frozen_string_literal: true

require "active_record"
require "encoded_id"

module EncodedId
  module Rails
    module PathParam
      def to_param
        encoded_id || raise(StandardError, "Cannot create path param for #{self.class.name} without an encoded id")
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
encoded_id-rails-1.0.0.beta3 lib/encoded_id/rails/path_param.rb
encoded_id-rails-1.0.0.beta2 lib/encoded_id/rails/path_param.rb
encoded_id-rails-1.0.0.beta1 lib/encoded_id/rails/path_param.rb