You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
From what I read in what's inserted in initializers/devise.rb after running
$ rails generate devise_invitable:install
If I were to modify this:
# The class name of the inviting model. If this is nil,# the #invited_by association is declared to be polymorphic.# Default: nil# config.invited_by_class_name = 'User'
and uncomment the config.invited_by_class_name = 'User' line, I expected for the invited_by not to be polymorphic, since it says it will be polymorphic if it is nil, suggesting that it wouldn't be polymorphic if it wasn't nil.
To clarify, now that devise.rb block is
# The class name of the inviting model. If this is nil,# the #invited_by association is declared to be polymorphic.# Default: nilconfig.invited_by_class_name='User'
As I read in the README, I manually changed my models/user.rb file and added the following line:
I manually edited the migration file and the migration worked as I expected, but from what the devise.rb file says I expected for that migration to be created with the foreign_key to the config.invited_by_class_name. If not, what's it for?
Am I wrong to have expected that behaviour?
The text was updated successfully, but these errors were encountered:
You can change migration template to check that setting, or other related settings too, and send pull request. However those settings can be changed per model, as devise readme explains, if invited_by_class_name is set for one model only, generated migration must be changed.
Hello,
From what I read in what's inserted in initializers/devise.rb after running
If I were to modify this:
and uncomment the
config.invited_by_class_name = 'User'
line, I expected for theinvited_by
not to be polymorphic, since it says it will be polymorphic if it isnil
, suggesting that it wouldn't be polymorphic if it wasn't nil.To clarify, now that devise.rb block is
As I read in the README, I manually changed my models/user.rb file and added the following line:
Later I ran
It annotated the models/user.rb file and also created a migration file (devise_invitable_add_to_users).
I expected it to have this
or something like that, but instead it had this:
I manually edited the migration file and the migration worked as I expected, but from what the devise.rb file says I expected for that migration to be created with the foreign_key to the config.invited_by_class_name. If not, what's it for?
Am I wrong to have expected that behaviour?
The text was updated successfully, but these errors were encountered: