class UserGroup
has_many :users
end
class User
has_many :posts
end
class Post
end
Can we search the fields in user_group in the position of post using ransack?
Thanks!
you may try something like Post.ransack(user_user_group_type_eq: 'admin')
here I am assuming UserGroup class will have a column type
and comparing it to value admin