I have this scope in my Answer model
scope :court, where(joins(:case))
When I use the scope in Console I got this error
> Answer.court
(0.3ms) SELECT COUNT(*) FROM `answers` INNER JOIN `cases` ON `cases`.`answer_id` = `answers`.`id`
TypeError: Cannot visit ActiveRecord::Relation
so what’s this error really mean?, Is the scope syntax is wrong although the SQL query is right??
the scope should be defined as