Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecation warning with Rails 5.1.0.rc1 #260

Closed
spdawson opened this issue Apr 2, 2017 · 12 comments · Fixed by #263
Closed

Deprecation warning with Rails 5.1.0.rc1 #260

spdawson opened this issue Apr 2, 2017 · 12 comments · Fixed by #263

Comments

@spdawson
Copy link

spdawson commented Apr 2, 2017

The following code is in my model class.

attr_encrypted :blob

When I use the blob accessor method, the following appears in the Rails log.

DEPRECATION WARNING: blob is not an attribute known to Active Record. This behavior is deprecated and will be removed in the next version of Rails. If you'd like blob to be managed by Active Record, add attribute :blob to your class.

As suggested, adding

attribute :blob

to the model — immediately before the attr_encrypted call — silences the deprecation warning, and does not appear to impair the operation of the blob accessor method.

@ardavis
Copy link

ardavis commented Apr 6, 2017

When I added attribute :blob it looks like it shows up in the Rails console. Everything still seems to work as intended, is there a way to tell the attribute that it's overridden?

irb(main):001:0> MyObj
=> MyObj(id: integer, encrypted_blob: string, encrypted_blob_iv: string, blob: )

@grosser
Copy link
Contributor

grosser commented May 1, 2017

want to turn this into a PR ? :)

@codebycliff
Copy link

I'm running into this as well on Rails 5.1.

@grosser What did you have in mind for a pull request? I'm not familiar with the codebase, but my first guess would be to do class_eval to define attribute :xyz where :xyz is the symbol passed to attr_encrypted. I'm not sure if that's the right solution or would have any negative side effects. Let me know how I can help.

@grosser
Copy link
Contributor

grosser commented May 15, 2017

something like #263 ;)

@codebycliff
Copy link

Perfect. Thank you!

@avokhmin
Copy link

When will be a new version of gem?

@danielwestendorf
Copy link

A new gem release to get this included would be 💯.

@mmahalwy
Copy link

mmahalwy commented Feb 8, 2018

Any update on this?

@szymonbaranowski
Copy link

Would appreciate a release as well!

@jasonperrone
Copy link

Those Deprecation warnings are very ugly. When will this make it to master?

@nguyenductung
Copy link

Please release a new version of this gem

@casperisfine
Copy link

3.1.0 got released yesterday: https://rubygems.org/gems/attr_encrypted/versions/3.1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.