Closed shaug closed 6 years ago
https://github.com/contentful/contentful_model/blob/df8bd84b9fd0390797e79b4adf4137f0db445265/lib/contentful_model/base.rb#L24
The usec time format was introduced in Rails 5.
usec
http://api.rubyonrails.org/v5.0/classes/Time.html
If 4.2 compatibility is desired, then this format will need to be defined as such:
Time::DATE_FORMATS[:usec] ||= '%Y%m%d%H%M%S%6N'
Likewise, if this library is intended to be Rails-agnostic, then it's probably preferred to use strftime:
strftime
TIME_FORMAT = '%Y%m%d%H%M%S%6N'.freeze def cache_key(*timestamp_names) "#{self.class.to_s.underscore}/#{id}-#{updated_at.utc.strftime(TIME_FORMAT)}" end
Hey @shaug,
Thanks for this, I'll look into replacing the call with your suggestion.
Cheers
This has just been released as 1.0.1.
1.0.1
https://github.com/contentful/contentful_model/blob/df8bd84b9fd0390797e79b4adf4137f0db445265/lib/contentful_model/base.rb#L24
The
usec
time format was introduced in Rails 5.http://api.rubyonrails.org/v5.0/classes/Time.html
If 4.2 compatibility is desired, then this format will need to be defined as such:
Likewise, if this library is intended to be Rails-agnostic, then it's probably preferred to use
strftime
: