• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

appfolio / validates_timeliness / 19 / 11
98%
master: 98%

Build:
Build:
LAST BUILD BRANCH: supportRails52
DEFAULT BRANCH: master
Ran 12 Jul 2018 08:21PM UTC
Files 7
Run time 1s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

12 Jul 2018 08:14PM UTC coverage: 94.048% (-0.3%) from 94.355%
2.3.0, gemfiles/rails_5_0.gemfile

Pull #7

travis-ci

web-flow
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)
Pull Request #7: Support rails5.1 and rails 5.2

237 of 252 relevant lines covered (94.05%)

20.45 hits per line

Source Files on job 19.11 (2.3.0, gemfiles/rails_5_0.gemfile)
  • Tree
  • List 0
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 19
  • Travis Job 19.11
  • f74a8c6a on github
  • Prev Job for 2.3.0, gemfiles/rails_5_0.gemfile on supportRails52 (#16.11)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc