gitlab-org--gitlab-foss/app/models/concerns/iid_routes.rb

10 lines
376 B
Ruby
Raw Normal View History

2018-05-11 03:52:48 -04:00
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` explictly at each route generators. e.g. pipeline_path(project.id, pipeline.iid)
def to_param
iid.to_s
end
end