heapsource / active_model_otp

Adds methods to set and authenticate against one time passwords (Two-Factor Authentication). Inspired in AM::SecurePassword
MIT License
773 stars 81 forks source link

Error: "NoMethodError (undefined method `before_create' for {}:Hash)" when used with devise on ruby 3.0.0 #75

Closed Mariusio closed 3 years ago

Mariusio commented 3 years ago

I was trying to update my rails app to ruby 3.0.0 and noticed that when I tried to sign up new users using devise I get the following error:

NoMethodError (undefined method `before_create' for {}:Hash):

The issue goes away when I comment has_one_time_password out in the User model so it seems quite likely that it is related to this gem. Is this issue known / expected? Otherwise I can gladly post the exact steps to reproduce.

thuandoan274 commented 3 years ago

I have the same issues like you, also using ruby 3.0.0

NoMethodError (undefined method `has_one_time_password' for User:Class)

pedropereira commented 3 years ago

Looks like there's a fix being worked on here: https://github.com/heapsource/active_model_otp/pull/77

pedrofurtado commented 3 years ago

Glad to see a release with this fix 🎉 🎉

pedrofurtado commented 3 years ago

@Maarius I think we can close this issue, because https://github.com/heapsource/active_model_otp/pull/77 was merged 🏁

Mariusio commented 3 years ago

Awesome! Thanks for the ping @pedrofurtado