|
Ran
|
Files
7
|
Run time
1s
|
Badge
README BADGES
|
travis-ci
pl - add support for Rails 5.1, 5.2 - change gemspec - appraisal - generate gemfiles --- - fix `active_record.time_zone_aware_types` error happen in 5.1 and 5.2 ``` DEPRECATION WARNING: Time columns will become time zone aware in Rails 5.1. This still causes `String`s to be parsed as if they were in `Time.zone`, and `Time`s to be converted to `Time.zone`. To keep the old behavior, you must add the following to your initializer: config.active_record.time_zone_aware_types = [:datetime] To silence this deprecation warning, add the following: config.active_record.time_zone_aware_types = [:datetime, :time] ``` What does this even mean? I found an article explain it well http://engineering.liefery.com/2017/10/25/times-in-rails-5.html Here is a quick summary: ``` Here’s a good way of thinking about it: which columns in your application should return an ActiveSupport::TimeWithZone object? To keep the old behaviour and only have datetime columns return an ActiveSupport::TimeWithZone object, use [:datetime]. To use the new behaviour and have time columns also return an ActiveSupport::TimeWithZone object, use [:datetime, :time]. ``` Here is where I found how to config it without `Rails.config` http://api.rubyonrails.org/classes/ActiveRecord/Timestamp.html As the testcases suggest, it expects the old behaviour, i.e. only `datetime` is time zone aware. https://github.com/appfolio/validates_timeliness/blob/<a class=hub.com/appfolio/validates_timeliness/commit/4c80b403e500f36ca3d0d93cf312c0a30828b71c">4c80b403e/spec/validates_timeliness/orm/active_record_spec.rb#L90-L105 I changed `spec_helper.rb` to set `time_zone_aware_types`, but I don't know how to enforce it in a Rails app. --- In `lib/validates_timeliness/orm/active_record.rb`, the `timeliness_column_for_attribute` function depends on the internal implementation of ActiveRecord. https://github.com/appfolio/validates_timeliness/blob/4c80b403e500f36ca3d0d93cf312c0a30828b71c/lib/validates_timeliness/orm/active_record.rb#L17-L33 It gave me a really hard ... (continued)
237 of 252 relevant lines covered (94.05%)
20.44 hits per line
| Coverage | ∆ | File | Lines | Relevant | Covered | Missed | Hits/Line |
|---|