Skip to content

Commit 9f55ff5

Browse files
Merge pull request #3275 from DMPRoadmap/research_output_file_size_issue
Fix for issue #3161
2 parents 66cb809 + b8cc5ab commit 9f55ff5

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
### Added
44

55
- Added CHANGELOG.md and Danger Github Action [#3257](https://github.com/DMPRoadmap/roadmap/issues/3257)
6-
6+
- Added validation with custom error message in research_output.rb to ensure a user does not enter a very large value as 'Anticipated file size'. [#3161] (https://github.com/DMPRoadmap/roadmap/issues/3161)
77
### Fixed
88

99
### Changed

app/models/research_output.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ class ResearchOutput < ApplicationRecord
6464
allow_nil: true, allow_blank: true,
6565
message: UNIQUENESS_MESSAGE }
6666

67+
validates_numericality_of :byte_size, greater_than: 0, less_than_or_equal_to: 2**63,
68+
message: '(Anticipated file size) is too large. Please enter a smaller value.'
6769
# Ensure presence of the :output_type_description if the user selected 'other'
6870
validates_presence_of :output_type_description, if: -> { other? }, message: PRESENCE_MESSAGE
6971

0 commit comments

Comments
 (0)