Project

General

Profile

Actions

Patch #13498

closed

Better validation for identifier length

Added by Daniel Felix about 11 years ago. Updated over 10 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Code cleanup/refactoring
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:

Description

Please see...
source:trunk/app/models/project.rb#L76

This could be clearer with minimum and maximum.

Example:

validates_length_of :identifier, :minimum => 1, :maximum => 100, :allow_blank => false

Actions #1

Updated by Mischa The Evil about 11 years ago

Daniel Felix wrote:

Please see...
source:trunk/app/models/project.rb#L76

This could be clearer with minimum and maximum.

The current code is specifically done for easy changing the max. indentifier length. See #6446#note-12. I'd suggest to keep it like it is now.

Actions #2

Updated by Daniel Felix about 11 years ago

Ah okay.

But we'll the :maximum would achieve the same thing? There could be a reference to the variable too. :-)
Doesn't it?

What about the allow blank option?

Actions #3

Updated by Jean-Philippe Lang over 10 years ago

  • Status changed from New to Closed

There's a min and max in the current implementation. I don't know how it was when this patch was submitted, please reopen if needed.

Actions

Also available in: Atom PDF