I’m trying to verify that a parameter is an instance of a specific
class in Rails:
def schedule(action, *args)
if arg.is_a? Aircraft
I’m doing this in a library class (the file is in lib/) and I get an
uninitialized constant Aircraft error. Aircraft is a model class, with
a corresponding aircraft.rb file in app/models.
Can I use model classes and instances in a library? How?