-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Serialize updated at without to s #1381
Serialize updated at without to s #1381
Conversation
@MaicolBen Here is a passing version. |
|
@@ -1,12 +1,14 @@ | |||
module DeviseTokenAuth::Concerns::TokensSerialization | |||
extend self |
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.
👏
def serialize_updated_at(token) | ||
updated_at_key = ['updated_at', :updated_at].find(&token.method(:[])) | ||
|
||
if token[updated_at_key].respond_to?(:iso8601) |
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.
maybe we can write this better:
return token unless token[updated_at_key].respond_to?(:iso8601)
token.merge updated_at_key => token[updated_at_key].iso8601
@@ -55,16 +57,48 @@ | |||
assert_equal(ts.dump({}), '{}') | |||
end | |||
|
|||
it 'deserialize tokens' do |
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.
why did you remove this spec? are we having breaking changes here?
@@ -34,7 +34,7 @@ end | |||
|
|||
group :test do | |||
gem "rails-controller-testing" | |||
gem "simplecov", require: false | |||
gem "simplecov", "< 0.18", require: false |
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.
I don't know why this change but it's ok
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.
Newer simplecov is incompatible with codeclimate. codeclimate/test-reporter#413
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.
@briandunn can you check my comments and rebase?
I rebased it in #1423 |
The project I'm on has an overridden ::Time::DATE_FORMATS[:default] that does not include the seconds in the serialized time string. This broke batch detection in a way that was very difficult to track down. This PR uses iso8601 To serialize reliably.