Skip to content

Commit

Permalink
Merge pull request #1700 from ualbertalib/cds/invalid-dates-coerced
Browse files Browse the repository at this point in the history
* Now ignoring strings of length 4 for dates in coerce_value
  • Loading branch information
ConnorSheremeta authored Jun 26, 2020
2 parents 8f3b104 + 44f0348 commit 9aabad8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ and releases in Jupiter project adheres to [Semantic Versioning](http://semver.o

## [Unreleased]

### Fixed
- Now ignoring strings of length 4 for dates in coerce_value [PR#1700](https://github.com/ualbertalib/jupiter/pull/1700)

### Changed
- Beefed up AR migrations by stating that certain attributes cannot be null [PR#1704](https://github.com/ualbertalib/jupiter/pull/1704)

Expand Down
2 changes: 1 addition & 1 deletion app/models/jupiter_core/locked_ldp_object.rb
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ def coerce_value(value, to:)
when :json_array
JSON.parse(value)
when :date
if value.is_a?(String)
if value.is_a?(String) && value.length != 4
Time.zone.parse(value)
elsif value.is_a?(DateTime)
value
Expand Down

0 comments on commit 9aabad8

Please sign in to comment.