How can I create a scope that fetches all Jobs that have one Jsoon?
#Job
has_one :jsoon, as: :jsoonable, dependent: :destroy
def self.hasjsoon
where(joins(:jsoon))
end
#Console:
Job.hasjsoon
Gives the error
Unsupported argument type: #<Job::ActiveRecord_Relation:0x00007f9e804936c8> (Job::ActiveRecord_Relation))
You don't need
whereto fetch all Jobs that have one JsoonThis is enough