Closed akefeli closed 3 years ago
To get around this you can explicitly call the scope from the model class like so:
class Person < ApplicationRecord
has_many :jobs, -> { Job.completed }, class_name: "Job"
end
class Job < ApplicationRecord
scope :completed, -> { where... }
end
Ty! @DanielGilchrist
I have a
has_many
association with a scope defined on the associated class. But srb is expecting methodcompleted
to be defined in Person class. Is there a workaround for this?Steps to reproduce:
Method completed does not exist on T.class_of(Person) https://srb.help/7003
Expected behavior: It should not complain about method being missing
Versions: