summaryrefslogtreecommitdiff
path: root/app/models/concerns/iid_routes.rb
blob: 246748cf52cb35788a61454952ecefc8b66728cd (plain)
1
2
3
4
5
6
7
8
9
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