gitlab-org--gitlab-foss/app/models/concerns/iid_routes.rb
Rémy Coutable f49aeacdd0
Merge branch 'fix-misspellings-app-comments' into 'master'
Fix misspellings in app/spec comments

See merge request gitlab-org/gitlab-ce!25517
2019-02-26 12:25:01 +01:00

11 lines
408 B
Ruby

# frozen_string_literal: true
module IidRoutes
##
# This automagically enforces all related routes to use `iid` instead of `id`
# If you want to use `iid` for some routes and `id` for other routes, this module should not to be included,
# instead you should define `iid` or `id` explicitly at each route generators. e.g. pipeline_path(project.id, pipeline.iid)
def to_param
iid.to_s
end
end