tl;dr - ActiveSupport::TimeWithZone used absolute seconds counting to determine dates while DateTime used a proper Gregorian calendar. This means dates before October 15, 1582 have different internal values when compared.
The behavior showed up because a test was using a DateTime value to set a MySQL DATETIME column to the DB minimum value, which is 1000-01-01 00:00:00, and then comparing the DB record attribute to the original variable used to set it.
Something like:
date = DateTime.new(1000, 1, 1, 0, 0, 0, 'UTC')
record.update(happened_at: date)
record.happened_at == date # => false
I "discovered" the missing Gregorian dates when I wrote a loop counting forward in time from Jan 1, 1000 until the corresponding TimeWithZone and DateTime records returned true when compared with ==.
No joke, I actually hit this condition in a test suite and ended up stumbling across the October 1582 date in a Ruby library. It wasn't until I searched "October 10 1582" on the Web that I learned the significance.
https://gist.github.com/abachman/f97806e1c0fe8e4e1849e5f8412...
tl;dr - MySQL uses 1000-01-01 as the minimum value for a datetime field. Different Ruby libraries use different methods to represent dates, which can lead to situations that appear to claim that 1000-01-01 != 1000-01-01.
"Are you an untrustworthy person?" Are you likely to take a bribe? Will you get mad at your boss and try to burn the place down, literally or metaphorically? Will you be careless in a way that brings about the same, with no malice?
"Are you as trustworthy as anyone else, but subject to inhuman pressure?" Anyone would be vulnerable to having a relative threatened; you probably don't want to hire someone who would be apathetic to having their parents or child threatened. If that relative is already in unfriendly hands, that's a huge risk.
In some ways, a $100k house in a (hostile) foreign country is no different than a $100k bribe; it's just stuff. If you ignore a threat to your property in a scheme to extort you, you are $100k poorer than if you give in, just like if you turn down a bribe. But humans are prone to loss aversion. Having $1 taken from you is far worse than receiving $1 is good, even ignoring any sentimental value of the property in question. Some people will still be able to ignore the threat, not allow themselves to be compromised, but a lot of people will find it hard.
For a job where security is a concern and you have thousands or millions of perfectly cromulent candidates, it's not crazy to winnow the pool first by discarding everyone who's untrustworthy or has extra levers that can be used against them. You still have thousands or millions of great candidates left.
Yes they can, which is why there are many many factors considered in granting and maintaining a clearance. None of them are simple black and white things. For foreign property, it is very different owning a small vacation house and owning a house where 3 generations of your spouse’s family live or owning a commercial property that provides a significant income to you. A foreign government putting each of those things at risk would have very different implications.
Only if you don't take 30 seconds to think about it.
Of course you can be compromised without owning foreign property. But foreign property is a vector by which you can be compromised.
Doesn't it make sense an intelligence agency would want to know all the possible vectors by which potential employees could be compromised? For each vector you'll have certain remediation steps, up to and including "don't hire this person."
sure, but it's way easier for the FBI to request the title and deed for things in the US and track their history than an apartment building in Panama, or a plantation in Indonesia.
Is this weakness in their training regimen the impact of operating under regulatory frameworks for too long?
reply