Your code should be:
def self.not_active
includes(:owner).where("owners.active = ?", false)
end
When referencing a model in pure SQL, as you are doing so above, you need to use the table name, not the singular model name. Thus, owners, not owner.
A clearer style would be:
def self.not_active
includes(:owner).where(owners: {active: false})
end
Rails AREL will take care of referencing the active attribute in the query correctly, and you don't have to worry about the exact table/model name.