Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix
ActiveModel::Type::DateTime#serialize
`ActiveModel::Type::DateTime#serialize` should return a `Time` object so that finding by a datetime column works correctly.
- Loading branch information
Lisa Ugray
committed
Jul 5, 2017
1 parent
2ae84d2
commit 7b2dfde
Showing
2 changed files
with
17 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,10 @@ def type | |
:datetime | ||
end | ||
|
||
def serialize(value) | ||
super(cast(value)) | ||
end | ||
|
||
private | ||
|
||
def cast_value(value) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters