jeremyevans / rodauth

Ruby's Most Advanced Authentication Framework
http://rodauth.jeremyevans.net
MIT License
1.65k stars 95 forks source link

Fix already initialized constant Account::VerificationKey warning #332

Closed bkuhlmann closed 1 year ago

bkuhlmann commented 1 year ago

Overview

Hello. :wave: I'm experiencing an issue where I'm seeing a bunch of warnings in my console (dev and test) when using Rodauth in my Rails app:

/Users/bkuhlmann/.cache/frum/versions/3.1.3/lib/ruby/gems/3.1.0/gems/rodauth-model-0.2.1/lib/rodauth/model/active_record.rb:69: warning: already initialized constant Account::VerificationKey
/Users/bkuhlmann/.cache/frum/versions/3.1.3/lib/ruby/gems/3.1.0/gems/rodauth-model-0.2.1/lib/rodauth/model/active_record.rb:69: warning: previous definition of VerificationKey was here
/Users/bkuhlmann/.cache/frum/versions/3.1.3/lib/ruby/gems/3.1.0/gems/rodauth-model-0.2.1/lib/rodauth/model/active_record.rb:69: warning: already initialized constant Account::RememberKey
/Users/bkuhlmann/.cache/frum/versions/3.1.3/lib/ruby/gems/3.1.0/gems/rodauth-model-0.2.1/lib/rodauth/model/active_record.rb:69: warning: previous definition of RememberKey was here
/Users/bkuhlmann/.cache/frum/versions/3.1.3/lib/ruby/gems/3.1.0/gems/rodauth-model-0.2.1/lib/rodauth/model/active_record.rb:69: warning: already initialized constant Account::PasswordResetKey
/Users/bkuhlmann/.cache/frum/versions/3.1.3/lib/ruby/gems/3.1.0/gems/rodauth-model-0.2.1/lib/rodauth/model/active_record.rb:69: warning: previous definition of PasswordResetKey was here
/Users/bkuhlmann/.cache/frum/versions/3.1.3/lib/ruby/gems/3.1.0/gems/rodauth-model-0.2.1/lib/rodauth/model/active_record.rb:69: warning: already initialized constant Account::LoginChangeKey
/Users/bkuhlmann/.cache/frum/versions/3.1.3/lib/ruby/gems/3.1.0/gems/rodauth-model-0.2.1/lib/rodauth/model/active_record.rb:69: warning: previous definition of LoginChangeKey was here

Steps to Recreate

I'm afraid I don't have a quick way to reproduce this for you in an isolated environment but can try to do that if it'd help. I mostly wanted to report this in case you weren't aware. As a workaround, I can use your excellent Warning gem to workaround these issues.

Environment

jeremyevans commented 1 year ago

This error appears to be in rodauth-model, not in Rodauth itself. You may want to report it there: https://github.com/janko/rodauth-model/issues/new

bkuhlmann commented 1 year ago

Thanks and apologies. Fixed.