Closed tatey closed 10 years ago
Hey thanks for the pull request. That's an annoying bug.
But can I suggest something even more dramatic? Could you remove the fail
statement completely? Type detection is an enormous code-smell, I hadn't noticed that in the codebase
(Also, raising that error doesn't seem to do anything useful - it'd fail on the strftime
call anyway if it's not defined. Nickel should be duck typing, not pretending to be statically typed)
Thanks for the fast response.
I wasn't sure how the patch would go down so I opted to preserve the existing behaviour. Very happy to remove the fail
altogether.
Would you like me to rebase into a single commit?
Sure, rebasing would be great, thanks.
I'll update and publish the gem once I get the new version of the pull request.
0.1.6 of the gem has your change
Thanks a tonne!
On 15 Jul 2014, at 8:48 pm, Iain Beeston notifications@github.com wrote:
0.1.6 of the gem has your change
— Reply to this email directly or view it on GitHub.
This patch relaxes the type checking when parsing an explicit time object to Nickel. If that time object happens to be an instance of
ActiveSupport::TimeWithZone
then nickel parses the query string instead of blowing up.Without the patch.
With the patch.
We need this patch because our client posts to the server with a UNIX timestamp (Eg:
1405065600
) and timezone (Eg:"Sydney"
) for each request.Any feedback is welcome.