There are various expressions in redmine's Plugin Tutorial, but I personally think that find () should be used only for id.
Because it is overridden in the Redmine code as follows.
app/models/project.rb
def self.find(*args)
if args.first && args.first.is_a?(String) && !args.first.match(/^\d*$/)
project = find_by_identifier(*args)
raise ActiveRecord::RecordNotFound, "Couldn't find Project with identifier=#{args.first}" if project.nil?
project
else
super
end
end
Recommended Posts