Closed vincentwoo closed 7 years ago
Our config file looks like:
Invitation.configure do |config|
config.routes = false
config.user_model = ::User
config.user_registration_url =
->(params) { Rails.application.routes.url_helpers.new_user_registration_url(params) }
end
Did the string constantization thing break something?
Confirmed that using '::User'
or just leaving the config line out (since Invitation sets one by default) fixes the issue. I think the gem should accept either format and that you should put out a fix and yank 0.4.2.
You're right, the gem configuration's user_model setting should accept both the Class or a String. My apologies for this oversight.
Setting the user model class directly (rather than just it's name) can cause other errors in some cases, hence the change (see https://github.com/tomichj/invitation/issues/8).
I'm going to add a warning when user_model is set directly to the user class, but will allow it to accept either a String (the name) or the Class.
Fix coming shortly.
0.4.3 released with fix
thanks for the bug report, I appreciate it