2018-08-03 13:22:24 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-05-11 03:52:48 -04:00
|
|
|
module IidRoutes
|
2018-05-08 01:57:41 -04:00
|
|
|
##
|
|
|
|
# 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,
|
2019-02-25 15:53:09 -05:00
|
|
|
# instead you should define `iid` or `id` explictly at each route generators. e.g. pipeline_path(project.id, pipeline.iid)
|
2018-05-08 01:57:41 -04:00
|
|
|
def to_param
|
|
|
|
iid.to_s
|
|
|
|
end
|
|
|
|
end
|