I am implementing user setting in my rails website where a user has control over who can send him notifications. The allowed classed of users who can send him information is stored in an array and can be set by the user.
How do I query users to send the notification according to the user type of the user who sent the post.
I want to do something like this.
notifiable_users = User.all.or("notification_setting.posted_by" includes "sender.user_type")