Commit
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,7 +41,7 @@ def define_method_attribute=(attr_name) | |
if create_time_zone_conversion_attribute?(attr_name, columns_hash[attr_name]) | ||
method_body, line = <<-EOV, __LINE__ + 1 | ||
def #{attr_name}=(original_time) | ||
time = original_time.dup | ||
time = original_time.dup unless original_time.nil? | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
adzap
Contributor
|
||
unless time.acts_like?(:time) | ||
time = time.is_a?(String) ? Time.zone.parse(time) : time.to_time rescue time | ||
end | ||
|
2 comments
on commit 40aefb9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tenderlove @brianmario upon searching, I can't find one. I was told about it in a bug report elsewhere. Perhaps they used 'data type' too liberally. I am not up to date with Mysql features so I didn't question it.
Perhaps we can ignore that case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This error also affects 3-0-stable, I create a patch in lighthouse for the same problem: https://rails.lighthouseapp.com/projects/8994/tickets/6367-timezone-aware-attributes-fail-with-nil-assignments
You also can't dup a Fixnum.