This is not an answer, since it's not tested, but I wanted to try and I needed formatting.
For your code it makes more sense to me to have two scopes in Profile
:
belongs_to :account
scope :user, joins(:account).where(account: {owner_type: :User} )
scope :organization, joins(:account).where(account: {owner_type: :Organization} )
If you want anyway those other classes you could do:
class UserProfile
self.table_name = 'profiles'
default_scope joins(:account).where(account: {owner_type: :User} )
and so on with Organization profile.
In case joins is not working like that, try:
joins(:account).where('accounts.owner_type = User')
or
joins(:account).where(accounts: {owner_type: :User} )
I am not sure ActiveRecord receives hash there.