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

alias_method_chain is deprecated #193

Closed
connorshea opened this issue Feb 25, 2016 · 11 comments
Closed

alias_method_chain is deprecated #193

connorshea opened this issue Feb 25, 2016 · 11 comments

Comments

@connorshea
Copy link
Contributor

I keep getting this deprecation warning with Ruby 2.3.0 and Rails 5:

DEPRECATION WARNING: alias_method_chain is deprecated. Please, use Module#prepend instead. From module, you can access the original method using super. (called from <top (required)> at /Users/connor/.rvm/gems/ruby-2.3.0/bundler/gems/devise-two-factor-ba6c4c53efcc/lib/devise_two_factor/models/two_factor_authenticatable.rb:1)

Initially I thought this was an issue with devise_two_factor, but the line it refers to is require 'attr_encrypted'. Updating the gem to use attr_encrypted v2.0.0 doesn't fix this issue, unfortunately.

alias_method_chain is used throughout this file.

Would it be possible to remove these from the gem? It's clogging up my terminal a bit :)

screen shot 2016-02-25 at 12 35 53 pm

@connorshea
Copy link
Contributor Author

Here's the first and the second Rails PRs that deprecated alias_method_chain.

Deprecated by Rails 5.0.0, you can test it on the beta releases if need be.

@saghaulor
Copy link
Contributor

Thanks for opening this issue @connorshea I am aware that alias_method_chain is deprecated in Rails 5. I intend to address this issue in a later release. However, you're welcome to open a pull request if you end up implementing the solution first.

@sblackstone
Copy link

sblackstone commented May 12, 2016

#213 Removes dependencies on alias_method_chain

but does require that the version of ruby running supports prepend..

@dwickwire
Copy link

Version 3.0.1 still has the alias_method_chain so we just need a patch level bump to 3.0.2 to get the transition from alias_method_chain to alias_method in May.

In the meantime if you just want to upgrade to Rails 5 you can just point to github in your Gemfile:

- gem 'attr_encrypted', '3.0.1'
+ gem 'attr_encrypted', git: 'git://github.com/attr-encrypted/attr_encrypted.git'

@gylaz
Copy link

gylaz commented Jul 13, 2016

Any idea when a new version with the fix for this will be released?

@saghaulor
Copy link
Contributor

I'll try to push a new release tonight. I was trying to kill a few more low hanging fruit issues before I pushed a new release.

@saghaulor
Copy link
Contributor

Closed by #214

@connorshea
Copy link
Contributor Author

@saghaulor thanks!

@saghaulor
Copy link
Contributor

For those of you following this thread waiting for a gem push, I've hit a speed bump. The travis build for Rails 5 using Ruby 2.3 is failing. I need to investigate the failure. You're welcome to help.

When I get the build passing I'll push the new gem version.

@saghaulor
Copy link
Contributor

Please see https://rubygems.org/gems/attr_encrypted/versions/3.0.2 for the new version.

@croaky
Copy link

croaky commented Jul 15, 2016

Thank you!

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

No branches or pull requests

6 participants