We've moved discussions to Discord

Pay/Subscriptions Dashboard Owner showing and not showing depending on dashboard screen

Darren Smyth
Hi everyone.

I'm in awe of everyone using JumpstartPro and who adds discussions every day. I can only wish I had your technical skills and understanding of the Ruby framework.

I'm a little out of my depth and wondering if someone can help me with why, when I go to the account screen dashboard for a user it shows the subscriptions information with the Owner name:

image.png 12 KB


But, when I try and access it from the Pay/Subscriptions page, which seems, from what I can work out, to take the information from the same dashboard file, the following happens (for the same user):

image.png 20.6 KB


I've recently updated to have the multi-tenancy added on my development machine but don't know what I've missed which would cause the above.

I've checked on my production server - which is still running the older version of JumpstartPro - and it's working as it should showing the name on the Pay/Subscriptions page.

I've not changed the dashboard files.

Can anyone please help me out. I've completed a major UI and useability update for the whole site and would love to load it. I'm a teacher and recording videos for kids who are in isolation at home. Hence, wishing to have this solved.

Thanks for anything anyone (and hopefully Chris Oliver ) might be able to suggest


Chris Oliver
Darren Smyth That could be a bug in the Administrate config. 

That field is now Polymorphic in Pay v2.1 and I think we still have the field marked as a BelongsTo with a hardcoded model name instead of using the Polymorphic field in Administrate. I'll have to check.

Could you pull up that record in the Rails console and confirm that it has both an owner_type and owner_id assigned?
Chris Oliver
Looks like I can replicate it locally and it is because of the BelongsTo field instead of Polymorphic it seems.

I'll publish an update, but you can just change that field in the Pay::Subscriptions dashboard file if you want to update it.
Chris Oliver
Pushed that change. 👍
Darren Smyth
Hi Chris Oliver

Thanks so much for looking into this. I've pulled the latest update and it's still not made any difference.

I've looked at the pay_subscriptions table and can see that whilst this use has an owner_id, there seems to be no reference to an owner_type.

image.png 4.94 KB


image.png 7.16 KB


Should there be something here?

Thanks in advance
Chris Oliver
Update your owner_type column for all of them to "Account". This should have been done automatically in the migration but maybe it didn't. It might be missing the reset_column_information call actually.

https://gitlab.com/gorails/jumpstart-pro/-/blob/master/db/migrate/20200326020204_add_owner_type_to_pay_models.rb#L7
Chris Oliver
Have you already run that migration?
Darren Smyth
I worked out the problem in the end and was coming back to delete my message. You beat me to it! You work long hours Chris Oliver !!

I downloaded all the data from my production server after I upgraded. Hence, the migration  changed all the values to "Account" in an empty table. I then imported the data meaning the column remained empty.

I've just found the migration and updated the value to "Account" and all is working.

I'm truly sorry if I've wasted your time.

The updated site is now live and working.

I can't thank you enough.
Notifications
You’re not receiving notifications from this thread.