diff --git a/lib/dunlop/ember/api_base_controller.rb b/lib/dunlop/ember/api_base_controller.rb index 86c0483..2d3f763 100644 --- a/lib/dunlop/ember/api_base_controller.rb +++ b/lib/dunlop/ember/api_base_controller.rb @@ -144,7 +144,11 @@ module Dunlop::Ember::ApiBaseController def find_record(options = {}) scope = record_scope scope = scope.includes(*Array.wrap(options[:includes])) if options[:includes] - @record = scope.find(params[:id]) + if record_class.include?(HasUuidIdentifier) and HasUuidIdentifier::UUID_MATCH =~ params[:id].to_s + @record = scope.find_by(identifier: params[:id]) or raise ActiveRecord::RecordNotFound # I (Benjamin) don't agree with this (raising) behaviour, but this is the rails standard for raising and rescue + else + @record = scope.find(params[:id]) + end end def record_params