Merge 0.6 and master branches to add support for Rails >= 4.2 #74
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds support for both 4.2.x and 5.2 and up by having two versions of
Vault::EncryptedModel
in the codebase they both work very differently, so it made the most sense to keep them separate.This now means that when we want to make changes to one of the versions of
Vault::EncryptedModel
we'll need to make the change in two files, this is a better solution than the current process as previously we had to manage two codebases and two versions, so it's a step in the right direction.Changes:
Adds support for Rails 4.2 and up
No longer need to
include Vault::AttributeProxy
to getvault_attribute_proxy
as it is part ofVault::EncryptedModel
for both 4.2.x and 5.x versions (This is not a breaking change as it only displays a warning)If a
type
is provided which doesn't exist as a validActiveRecord::Type
in the 5.x and up version onVault::EncryptedModel
we now fall back toActiveModel::Type::Value
e.g.IPAddr
will now use theActiveModel::Type::Value
typeBreaking change - Passing an ActiveRecord type as an object to
type
e.g. the below is no longer supported, use a symbol e.g.:time
instead.This is hard to tell in the PR but the change was on this line https://github.com/FundingCircle/fc-vault-rails/pull/74/files#diff-49c0b5f7740f6464b0867afa2fe6c6e5R172 previous it was
attribute_type