router_constraints.rb revision 419f986abb76f6fce54b71e17f52a1deaa06dbd6
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen params = request.send(:env)["action_dispatch.request.path_parameters"]
f16c114c20bbd7d292d93415d1e56c8dd6abd3e7Timo Sirainen return false if Repository.find_by_path(request.params[:repository_id]).nil?
f16c114c20bbd7d292d93415d1e56c8dd6abd3e7Timo Sirainen set_params_path_without_format(request) if result
f16c114c20bbd7d292d93415d1e56c8dd6abd3e7Timo Sirainen @params = request.send(:env)["action_dispatch.request.path_parameters"]
f16c114c20bbd7d292d93415d1e56c8dd6abd3e7Timo Sirainen @path += ".#{@params[:format]}" if @params[:format]
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen @params.merge({ path: @path }).except(:format)
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen @params.merge!({ path: @path }).except!(:format)
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen repository_id: ontology.repository.to_param, id: ontology.id)
98c1cf256927e254f0c092acd2ddcd7ea50bd009Timo Sirainenclass RefIRIRouterConstraint < IRIRouterConstraint
f7d43647acc6dc80064c8c4cacf5bf86f754c530Timo Sirainen # remove the ref/:version_number portion from path
98c1cf256927e254f0c092acd2ddcd7ea50bd009Timo Sirainen path = request.original_fullpath.sub(%r{\A/ref/\d+/}, '')
02b79f9c2636da1829eee5b92753602bba8b67edTimo Sirainen self.mime_types = mime_types.flatten.map { |m| Mime::Type.lookup(m) }