Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Buxfix when time_field is not string #24

Merged
merged 2 commits into from
Mar 24, 2014

Conversation

hbu50
Copy link
Contributor

@hbu50 hbu50 commented Mar 21, 2014

Don't parse non string value as time.

If a time_field? determined value is not string dont parse it.
@@ -99,7 +99,7 @@ def decode_hash(hash)
end

def decode_hash_value(key, value)
if time_field?(key, value)
if value.is_a?(String) && time_field?(key, value)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could probably move this guard inside of the time_field? method for clarity. It would be great if we we could find a way to call Time.at on Unix epoch values.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consider all float and integer value as Unix timestamp?

@hbu50 hbu50 closed this Mar 24, 2014
@hbu50
Copy link
Contributor Author

hbu50 commented Mar 24, 2014

mistakenly closed

@hbu50 hbu50 reopened this Mar 24, 2014
@pengwynn
Copy link
Member

pengwynn added a commit that referenced this pull request Mar 24, 2014
Buxfix when time_field is not string
@pengwynn pengwynn merged commit 3c6d34b into lostisland:master Mar 24, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants